Capturing an interview location
You can set up an online survey so that you can store the location where the interview is conducted.
This only works if the survey is running on a device which can capture geolocation information, such as a GPS-enabled tablet. You could either use a web browser to view the survey or use the Interviewer app to run the survey on the mobile device.
This facility is most useful when you wish to record geolocations when carrying out interviews with using the Interviewer app.
Setting up the location variable
Location variables are only useful if you are creating an online survey that is used on a mobile device, or a mobile survey for the Interviewer app. Location data is only available in Snap XMP Online and Interviewer editions.
- Select a mobile edition in your questionnaire.
- Click to display the Questionnaire Properties dialog box.
- Scroll down the options on the left to find the Paradata section.
- Highlight the Geolocation field and check the box marked Use in survey.
- Press OK to return to the questionnaire.
- The ID.location variable will appear below the title.
- To hide the variable name on the questionnaire, highlight the text ID.location, and select the Show toolbar option.
- Select Name in the next dropdown list if not displayed and uncheck the Show box. The ID.location text will be hidden.
- Change the default text to “Current location: please wait until the location has been found.” This will ensure that the interviewer allows the device some time to find the location.
- Click Save to save the changes to the questionnaire.
Configure the GPS timeout and accuracy
The two main methods of getting a location are using GPS or using information from mobile phone masts. GPS is more accurate but uses more battery power.
Note: Unless you know who is running your survey and what device it will run on, you cannot be sure whether the device running the survey has either of these methods enabled.
You can set a time limit on how long the survey will spend looking for location information and how accurate you would like the information to be.
- Click to display the Questionnaire Properties dialog box.
- Scroll down the options on the left to find the Paradata section.
- Highlight the Geolocation field and click Configure to open the Configure Geolocation dialog
- Set Timeout to how long (in seconds) that you want the device to keep searching for a location. The longer it searches the more battery it uses.
- Set Target accuracy to the precision that you would like to try and achieve. This is only a guide as the device may not be able to be this accurate.
- Press OK to return to the questionnaire.
You have no control over whether people permit the survey to use geolocation information, or whether their device is able to provide accurate geolocation information. If people are looking at surveys with a PC, the location provided may be that of a router.
Using location data in analyses
Geolocation data is captured in the ID.location variable in WGS84 (World Geodesic System) format. You can export the variable data for further analysis. The variable can either contain location data or an error code if the location data was not found.
You can extract the separate elements of the location data by using the system patterns geo unavailable and geolocation provided.
Element | Text |
Latitude | ID.location as geo latitude |
Longitude | ID.location as geo longitude |
Altitude | ID.location as geo altitude |
± Accuracy of location in meters | ID.location as geo accuracy |
Error code | ID.location as geo unavailable |
Example
Create a derived variable to extract the longitude to 3 decimal places. You need to add the paradata ID.location to your survey as a prerequisite.
- Click to display the Variables Window.
- Click to add a new variable.
- Specify the Variable Details:
- Name: Latitude
- Label: Latitude
- Type: Derived (the variable will derive its data from other existing variables).
- Response: Quantity
- Decimals: To access the Decimals field, click . Change the figure from 0 to 3.
- In the Code list, alongside the label Not asked, enter the value “unless ((ID.location as geo unavailable == “”)” to check that you are using a valid location.
- In the Code list, alongside the label Valid, enter the value “ID.Location as geo latitude”. This returns the latitude of the interview location, which you can use for analysis and reporting.
- Click Save to save the variable.
Exporting the location data
A common use for geolocation data is to export the data and use it with a mapping API, such as Google Maps. You can export the data directly in WGS84 format, or you can create derived variables to convert the data to a specified format.
- On the Snap XMP Desktop toolbar, click Data Entry to open the Data Entry window.
- Select File | Export to display the Data Export dialog.
- In Format, select the file format for the data export.
- Select File as the destination and enter an appropriate filename.
- In Content, enter the name of the variable(s) to export. The example shows ID.location
- Click OK to export the location data.