Location
Spotfire reserves two document properties for adding location services to an analysis. Such an analysis is designed to be used on a mobile device. The document properties are named
AppGeoLatitude
and
AppGeoLongitude
and are of data type
Real
.
An analysis that contains these document properties displays an active location icon on a mobile device. If the document properties are not included in the analysis, the location icon is not available.
When you add the document properties to a Spotfire analysis, set them both to 0.0. (The app interprets these values as setting the location to inactive.) When the mobile device user taps the location icon in the app, the current latitude and longitude are passed to the document properties
GreatCircleDistance()
to create a calculated column containing the distance between the device location and all locations in the data. Multiply the resulting value by the radius of the planet. (For more information on
GreatCircleDistance()
, see its reference topic in the
Spotfire help system.
- For kilometers, use 6371.
- For miles, use 3959.
For example, the following expression gives the distance in kilometers.
6371 * GreatCircleDistance(${AppGeoLatitude}, ${AppGeoLongitude}, [latitude_column_name], [longitude-column_name])
To begin adding location service to your mobile app-ready analysis, go to Adding positioning capabilities for mobile users.
- Adding location capabilities for mobile users
If your data has latitude and longitude columns, you can add the reserved document properties for geo-location. This task describes adding the properties as a first step to activating a location icon on a mobile device. - Adding distance calculation capabilities for mobile users
By adding a calculated column for distance to your location-aware Spotfire analysis, you can give Spotfire mobile app users the ability to find the distance from the device location and any latitude and longitude combination in the data set. - Adding visualizations for mobile app users to see location and distances
By adding a Spotfire Text Area and a details visualization to a location-aware analysis, you can provide users with interactive tools to find the distance to any point in the data set. - Adding expressions to find your location
After you have created a location-aware analysis for a mobile app, you can add expressions that can determine your location in the analysis on the mobile device. - Creating a map layer to highlight the device location
This task adds a marker to the latitude and longitude to a map analysis, identifying where a mobile app user is currently located when the user taps the location icon in the app.