Monday 19 September 2016

Latitude-longitude Coordinates In Anatrack Ranges

The issue of location coordinate systems comes up a lot in various guises so I thought I would post to the neglected Ranges blog with talk of these and how to convert, within the application, latitude-longitude coordinates to a usable system.

The key point is that, in Ranges, you must use a coordinate system that uses metres and not latitude-longitude degrees! To explain briefly: trigonometry, which Ranges uses heavily to do its calculations, will only run in a Euclidean coordinate system, one where n ticks in the x direction covers the same distance as n ticks in the y direction. Lat-long coordinate systems are not Euclidean not only due to the strange shape of the Earth but because e.g. three degrees of longitude covers a different distance depending on the latitude.

Lat-long coordinates are easily converted to a Euclidean system in metres, the standard system used is Universal Transverse Mercator (or UTM). It is possible that the device you used to collect the lat-long data also collected the UTM data but, actually, there are some advantages to using the new lat-long converter in Ranges as it will retain the UTM grid and allow easy conversion back to lat-long for direct display on Google Maps, for example, or export to KML.

The converter works when you import data. To import the lat-lng data you will first need it in a format Ranges understands which is tab or space delineated columns (one of the Excel output format options). I have created a sample data file with three columns (ID, Lat, Lng) containing some random locations around the Devon coast near to where I live.

Then I clicked import in Ranges, lined up the column headers with the Ranges Attribute (remember E=lng, N=lat!) and selected latitude-longitude to utm towards the bottom (lots more you can do here to collect more relevant data). Most data from GPS devices has a WGS84 ellipsoid but you might want to check yours. The import screen look like this:


Note that because Devon is west of the Greenwich Meridian, the longitudes are negative; coordinates in the southern hemisphere will have negative latitudes. I saved the data as a .loc file and can now view it in Ranges:


You will see the locations have large eastings and northings, now perfect for analysis. Next, I ran Convex Polygons 50/75/95:


If you now click modify you will see the edge file has been saved with the UTM zone data, retrieved during the loc data import:


This means that the edge graphics can be immediately viewed in Google Maps, clicking the Google g in the Ranges map display window: