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:

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi!
    I'm a novel Ranges 9 user, and I've some problems with coordinates.
    I want to create a new vector shape file using a background image, so as to digitise it and make a map suitable for my analysis. I've been able to create an .ima file, and set its world and image coordinates properly.
    The problem comes when I try to digitise it. I hold CTRL key down and left-click with the mouse, but then an error message appears:
    "Coordinates cannot be negative. This coordinate will be positionated on the axis"
    And, it fact, the point is then set on 0.0. This problem prevents me not only from digimousing my map, but also from creating a location file. I don't know what to do, as none of my coordinates are negative.
    This is my email: chica_spidey@hotmail.com
    Any help would be welcome. Thank you so much!

    ReplyDelete
    Replies
    1. Hi Alicia

      You are the very first to comment on one of our blog posts - it is excellent to see that this system is working. It is also great to see that you are using the background image function, massively improved in Ranges 9!

      Two things that spring to mind that you may be doing wrong: i) you are using lat-lng rather than UTM as your real world coordinates or ii) you have not matched the world coordinate with the correct image. Alternatively you may have found a bug with this new alignment feature.

      As a first step, I will contact your email directly and get you to send me your .ima file for investigation.

      Delete
    2. For those interested, the root of Alicia's problem was because her operating system was set to the Spanish locale. This displays numbers with a comma as the decimal separator rather than a full stop as we do in the United Kingdom. Ranges, of course, should not care about this but in the map digitization function, it was failing to recognise the non-UK formatted number and throwing an exception.

      We have fixed the bug (Ranges 9 v1.10) and Alicia is now successfully drawing locations on an aligned image.

      I am pleased to learn that she has also entered the UTM zones and can view her Ranges files superimposed on Google maps.

      Delete