This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

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 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 1

Create a derived variable to extract the longitude to 3 decimal places (d.p.). This assumes that you have added the paradata ID.location to your survey.

  1. Click Variables window button to display the Variables Window.
  2. Click New button to add a new variable.
  3. 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 Variable definitions button. Change the figure from 0 to 3.

    Values: ID.location as geo latitude

    New vaariable field getting context aspect

  4. Click Save button to save the variable.

Example 2

Extract the longitude and latitude to a single derived literal variable. This example tests to see if an error has been received, so only valid geolocations are stored. It then stores the latitude and the longitude, separated by a comma.

  1. Create a new derived variable
  2. Specify the Variable Details:

    Name: LatLong

    Label: Latitude and Longitude

    Type: Derived (the variable will derive its data from other existing variables).

    Response: Literal

    NA: unless ((ID.location as geo unavailable) == "")

    Values: ID.location as geo latitude:", ":ID.location as geo longitude

    New vaariable field getting context aspect

The : is a literal operator in Snap. It allows you to put different values together

  1. Click Save button to save the variable.

See Also

Setting up the location variable

Changing the way the location is found