Monday, July 29, 2013

Defining the Coordinate System with GTViewer 14





With GTViewer version 14, there is a change to the way your data’s Coordinate System is defined.  This change will affect anyone that does one or more of the following:
  • Uses the GPS to Track your location
  • Uses the Latitude/Longitude mode for the Coordinate Readout (on the status bar)
  • Uses the Locate X/Y command with the Latitude/Longitude option.
  • Uses the FromLatLong or ToLatLong methods in your code.
Previously, the GPSInfoFile entry was defined to point to a gpsinfo.ini file which was created when you selected a coordinate system on the GPS Dialog.  Now you must specify the coordinate system with the following entries in the [Additional Properties] section of the .GTM file.
o   CoordSys – This entry specifies the data’s Coordinate System.  Currently, two different specifications are accepted:

  • ProjectionParameters(name)  The Name value will appear on the GPS Dialog.  This specification type allows a PROJ.4 coordinate system parameter string to be specified with the CoordSysParam1 entry.  The CoordSysParam2 entry can be used to specify the Lat/long projection (it will default to NAD83).
  • GDA94(zone) – This specification type will the Geocentric Datum of Australia projection.  No parameters other than the zone are required.

o   CoordSysParam1 – this entry is used to specify the first parameter for Coordinate System if required.   Currently, this entry is only used if the CoordSys entry uses the ProjectionParameters type and is set to a PROJ.4 parameter string:

o   CoordSysParam2 – optional – this entry is used to specify the second parameter which specifies the Datum for the Latitude and Longitude projection to use.  By default, it is set to NAD83 for the ProjectionParameters type, but it can also be set to NAD27 and WGS84.

Example 1:

CoordSys=ProjectionParameters(NAD83 - Alabama East)
CoordSysParam1=+proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=199999.9999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs
CoordSysParam2=NAD83

Example 2:

CoordSys=ProjectionParameters(WGS84-UTM Zone 13N-Int Ft)
CoordSysParam1=+proj=utm +zone=13 +ellps=WGS84 +datum=WGS84 +units=ft +no_defs
CoordSysParam2=WGS84


When using the ProjectionParameters option, the CoordSysParam1 value is defined as a Proj.4 parameter string.   A website, http://spatialreference.org/ , can be used to get your coordinate systems specification.   Use the Search option to find your coordinate system and then get the Proj.4



Since the units default to meters, you may have to add a parameter to convert you coordinate:

+units=us-ft     for U.S. Survey Feet
+units=ft          for International Feet

You can also provide the conversion factor:

+to_meter=0.3048006096012192    for U.S. Survey Feet
+to_meter=0.304801                        for International Feet:


Alternative ways to Specify Coordinate System

Since this is a fairly significant change to GTViewer, you may find that you have .gtx files or older sets of data that don’t have this information in it.   There are several options you can use to add this new information into your previous datasets:
1)      You can create a text file with the same name as the .gtm or .gtx file with “.coordsys” on the end of it (demo.gtm would be demo.gtm.coordsys).    The file will just contain the same entries that you would normally put in the .gtm file. This file will only be used if there is no coordinate information defined in the .GTM or .GTX file.
2)      You can put a default file called coordsys.ini  in the %appData%\Graphic Technologies Inc\GTViewer\CoordSys directory.  This file just contains the coordinate system entries.  It will be used if no other coordinate system information is found (in the .gtm or in a .coordsys file).
3)      You can also use the addProp.ini file to add or override the coordinate system entries to the additional properties section, but this approach will only work with .GTX files, and will apply to all datasets in the same directory.


This post is also available a .pdf document from here.

No comments: