Interviewer > Customizing the applications > GPS feature > Reporting on location
 
Reporting on location
The LocationReport.mdd example interview script can be used to present GPS data on a map. The project can be activated for use by field managers for reporting on their interviewers. By default, the LocationReport.mdd example reports only on the GPSQuestion question. The example is installed to:
[INSTALL_FOLDER]\IBM\SPSS\<version>\DDL\" >Scripts\Interview\Utilities\LocationReport
Using the example
Before the LocationReport.mdd example can be used, you must obtain a Google Map API key (see Obtaining a Google API key)
The example is bound by the terms of use as stated at:
https://developers.google.com/maps/terms
Refer to the Google Maps API Documentation at:
https://developers.google.com/maps/documentation/
To use the example, open the LocationReport.mdd script in an UNICOM Intelligence application (Professional, Author, or the Interviewer Launch activity), activate or upload the example files to the server, and start the survey.
Files in the example
The GPS Reporting example contains these files:
DefaultLayout.htm_Files (directory)
DefaultGridTemplate.xml
DefaultLayout.htm
end.png
interview.png
LocationReport.mdd
Map.htm
Map.js
SameLine_Question.htm
start.png
Pages
The example includes these pages:
Login
Requests the field manager’s UNICOM Intelligence Interviewer Server Administration credentials. The credentials filter the project list to only those projects to which the field manager has permission.
Filter
Allows the field manager to select a project and to filter the project data. The page displays with a default filter that includes one week of interview data. The default filter also provides the field manager an example date/time format (the date/time is always entered in the interviewer's time zone). The field manager can use the Add Filter button to add an Interviewer ID filter. Additional filters are supported by modifying the LocationReport.mdd interview script.
Map
Displays the interview coordinates on a map. Each colored line represents an individual interviewer. The interview time is represented by a red triangle (start point) and a red square (end point). The blue person icons represent other interview points. For example:
Routing script functions
There are three main functions in the routing script:
CreateMap
This function provides a map that includes the GPSQuestion coordinates. The function relies on the GPS question name, GPSQuestion.
The function requires a third-party mapping service. For example, the Google Map API service URL at:
https://maps.googleapis.com/maps/api/js?key=xxx &sensor=false
The URL is referenced in theShowLocationOnMap.htm file. The client must obtain a Google API key before the file can be run.
CreateReport
This function creates the profile report via the TOM object. The UpdateLocation function must first be called to populate the GPSQuestion.Location field with the human-readable location that corresponds to the GPS coordinates.
This function is not called in the provided example. The function can be added in order to create a profile report that provides the respondent serial number, interviewer ID, interviewer start time, GPS coordinates, and user-friendly location information.
The provided example will need to be manually updated when a profile report, instead of a map, is required.
UpdateLocation
This function calls a third-party service to transform the GPS coordinates to a location name. The function depends on a third-party service. For example, the Google Coordinate Service URL is:
http://maps.googleapis.com/maps/api/geocode/xml?latlng=xxx,xxx&amp;sensor=false
The service can be accessed anonymously (with a usage limitation), or by obtaining an API key (see Setting up a GPS device).
This function is not called in the provided example. The function can be added in order to create a profile report that provides the respondent serial number, interviewer ID, interviewer start time, GPS coordinates, and user-friendly location information.
The provided example will need to be manually updated when a profile report, instead of a map, is required.
See also
Prerequisites for interviewing with a GPS question
Customizing the GPS question
Known issues
GPS feature