GPS Fields in Mobile Applications



Summary

Pendragon Forms enables your mobile users to capture GPS and extract data including UTM coordinates.

Features

Importing of forms for offline GPS

Requirements

Pendragon Forms 8

Android Device (Android 4.4.2 or higher preferred) with GPS Location services available and switched ON

Base Tutorial Time: 10 minutes

Tutorial

Form design

The GPS functionality for aquiring and fixing is controlled by the Special Field called "GPS".

All other fields, to store the data, should be created as Freeform Text fields.

Capturing data

Add the following script to retrieve the GPS data from your device and put the data into the temp variable:

  click:
    callmethod 1 "GPSINFO"
    temp = result


The command callmethod 1 "GPSINFO" refers to the GPS field in your form. If the GPS Special Field were to be in field 5, the script would be callmethod 5 "GPSINFO"

Additionally, to retrieve the standard latitude and longitude information, you can add the following script to your click command: (Note: $[Lat] means the value in a field whose Field Label on the Scripting tab is Lat.):

    extract "GPS.LAT" from temp
    $[Lat] = result
    extract "GPS.LONG" from temp
    $[Long] = result


For advanced scripting and to retrieve further GPS information, please see the "Parsing data and getting UTM" tab above.

Script to capture GPS data

Example Script in the GPS field will fire when you tap the FIX button, which appears after tapping the ACQUIRE button:
Note: When the script references $[Lat], $[Long], $[DECLAT], $[DECLONG], $[Accuracy] etc., you must have fields on your form with the Field Label on the Script tab filled in as Lat, Long, DECLAT, DECLONG, Accuracy. etc.

  click:
    callmethod 1 "GPSINFO"
    temp = result
    extract "GPS.LAT" from temp
    $[Lat] = result
    extract "GPS.LONG" from temp
    $[Long] = result
    extract "GPS.DECLAT" from temp
    $[DECLAT] = result
    extract "GPS.DECLONG" from temp
    $[DECLONG] = result

    extract "GPS.ACCURACY" from temp
    $[Accuracy] = result
    extract "GPS.ALT" from temp
    $[Altitude] = result

    extract "GPS.UTM" from temp
    $[UTM] = result

    extract "GPS.UTMZONE" from temp
    $[UTMzone] = result
    extract "GPS.UTMNS" from temp
    $[UTMns] = result
    extract "GPS.UTMX" from temp
    $[UTMx] = result
    extract "GPS.UTMY" from temp
    $[UTMy] = result

Mapping on GPS

Please see our tutorial for Mapping GPS on Google Charts for examples of how to map your collected data.

Downloads

Get Started With Your Free 14 day Trial!

Start Free Trial