Analyst, know thy coordinates
Recognising different coordinate systems can be helpful in speeding up your work.
It’s said that the Temple of Apollo at Delphi was inscribed with three key maxims for a good life, one of which was “Know Thyself”. This is, of course, very good advice. For the GIS analyst, knowing yourself helps to know when to walk away from the computer and get a breath of fresh air rather than smashing the screen in frustration. For that same GIS analyst, it’s also good advice to know about the coordinate system of your data. In this post we’ll look at sharpening your recognition skills for the most common coordinates that point data are in here in Aotearoa. This helps ensure that when we map them in a Cartisian X,Y space, they end up in the right place.
As most of you are probably aware by now, there are lots of different coordinate systems that we use in GIS, a dizzying array, in fact. Add to that the incredible range of map projections and one could easily get lost in the weeds of data preparation. Thankfully for us, being in a small country surrounded by 1,000s of kilometers of open ocean (i.e., no immediate neighbours) the main coordinate systems we usually deal with are limited. It’s down to three in fact: WGS84, New Zealand Map Grid (NZMG) and New Zealand Transverse Mercator (NZTM).
Over the years, I’ve had to deal a lot with these and so it’s not difficult to look at a set of coordinates and know pretty quickly which system they come from. This mainly comes into play when dealing with point data that may be sent to you in a spreadsheet or a text file, things like well data, or animal tracking points.
This is the 3-dimensional coordinate system that GPS uses, so it’s a global scale system that uses latitude and longitude in either degrees, minutes and seconds (DMS), e.g. 430 38′ 35″ S, or in decimal degrees (DD), such as -43.64305 (same location). Knowning the latitude and longitude allows us to locate any feature on the surface of the earth.
With DMS, the use of S and N tells us whether a latitude is south or north of the equator, while E and W tells us whether a longitude is east or west of the Prime Meridian. With DD, a negative in front of a latitude tells us we’re in the Southern Hemisphere, while a negative in front of a longitude means we’re west of the Prime Meridian, so paying attention to the negative values help us know which quadrant we’re in:
Decimal degrees are preferred in GIS when using lat/long (see here for how to convert between these two systems).
Here’s a quick example – I’m interested in mapping some groundwater quality data, so I head over the the LAWA Download Data page:
Further down the page is a link for these data as an Excel spreadsheet. When opened, I get this:
Lots of useful data here – measurements of five indicators: Chloride, Dissolved Reactive Phosphorus, E. coli, Electrical Conductivity and Nitrate Nitrogen with some measurements going back to 2004 across the motu and 158,745 rows all up.
I’ll only be able to map these data if they’ve got x,y coordinates. Low and behold, the column names are a dead giveaway: Latitude and Longitude, very much likely to be in WGS84. Apart from the column names, a few things help confirm these. Being in the southern hemisphere, it makes sense that the latitudes are negative and within the range I would expect for NZ. Longitude is positive, as it should be for NZ, and again within the expected range of values, so all good. As a next step, I’ll add this sheet to a map and use Display XY Data to map them:
Here’s where recognising the coordinate system comes into play. With Display XY Data, I need to explicitly set the attribute holding the X- and Y-coordinates and also set the Coordinate System. Getting this wrong could send the data into a purgatory of being lost:
In this case, Pro has been “smart” enough to recognise that WGS84 is the correct coordinate system. But if not, or it’s blank, I would click the globe icon and search for the right one (for WGS84, look in Geographic Coordinate Systems > World > WGS 1984 OR use the search window ORRR, since you’ve used WGS84 before, you’ve already set it as a favourite so you can pick it from there). Be a bit careful as there are multiple options – choose the one that’s just “WGS 1984”. With that done, click OK and points on the map are your uncle (bad play on an NZ idiom, sorry).
(Note how NZ is sort of slouching over – that’s because when the LAWAWells layer was added, the map used that layer’s coordinate system to set the map’s coordinate system, which makes NZ look a bit funny. We could always reset it to NZTM to correct its posture.)
Just to finish things off here, latitudes in NZ range roughly from -34.5 to -47.5 while longitudes range from 166.5 to 178.5 so if you get values outside these ranges, you can safely assume you’re outside mainland New Zealand.
In addition, you can plug lat/longs into Google Maps and see where they are, just as a test:
New Zealand Mag Grid is the former national projected coordinate system we used here up until the early 2000s. It was based on a spheroidal model of the planet called NZGD1949. As a projected system, it took the 3D lat/long coordinates from this spheroid and converted them to a flat, 2D X-Y grid in meters. This makes it handy for accurately measuring distances and areas. X coordinates are referred to as eastings while Y coordinates are northings. The origin of this grid sat somewhere in Cook Strait,
centrally located, and was assigned a set of false coordinates (2,510,000, 6023150) in such a way that:
All eastings are less than 5,000,000
All northings are greater than 5,000,000
(The units are metres.) This made it easy to look at the values and easily see that the easting is always less than the northing while also giving us no negative values. In NZMG, the point we saw in Google Maps above has easting and northings of 2467062.15 and 5729260.66 respectively. With enough experience, looking at just the first three digits can help to roughly get a sense of where in the country the points should be. You may well come across some data that are still in NZMG.
This was perfectly serviceable coordinate system for many years, but it biggest issue is that it didn’t play very nicely with GPS points, plotting them around 200 m north and 40 or so meters to the east of their correct position, so around 2000, a new spheroid was developed with a new coordinate system to go with it.
New Zealand Transverse Mercator is now the designated national coordinate system in our part of the world. Like NZMG is has on origin that has false coordinate assigned to it for the sake of convenience. For NZTM, the origin is at the same longitude, but its latitude is 0, so it sits on the equator.
With a new set of false coordinates:
All eastings are less than 2,000,000
All northings are greater than 4,000,000
Our point shown above would have coordinates of 1557067.60, 5167552.88
And they’re all the same location, so, in a strange way, you can sort of be in two or more places at a time…
The key advantage of NZTM is that it works very well with GPS points, so there are very few problems with mapping them. These are the coordinates you would see on all the Topo50 topographic maps.
So to briefly summarise, here are the same location’s coordinates in the three different systems:
WGS84: -43.6438, 172.4677
NZMG: 2467062.15, 5729260.66
NZTM: 1557067.60, 5167552.88
(And we haven’t even talked about the surveyors’ local circuits – let’s not for now.)
Distinguishing between MG and TM northings could get tricky, but MG eastings will always begin with a 2 and TM eastings will always start with a 1, so that helps a bit.
Being able to recognise points’ coordinate system is a small thing but it may be helpful in the ongoing checking that one tends to do to make sure everything’s working correctly. Better to pick up an error early on then to let it propagate through your whole analysis undetected.
Need to know more? LINZ has a great document that covers a lot of the gory details of NZ’s coordinate systems.
I don’t know if this post helps you know yourself any better but hopefully it can help you know that your points end up in the right place, which has got to help in some small way.