Summer services update
Information Summer services update

Our offices and services will have reduced availability over the holiday period.  Read more about our holiday hours and services availability.

Axis ordering

If your geospatial data appears flipped or rotated you may be experiencing axis ordering issues.

Axis order issues

The way Spatial Reference Systems are specified changed between Web Feature Services (WFS) version 1.0.0 and version 1.1.0. The coordinate system axis order was changed at versions WMS 1.3 and WFS 1.1. It is now based on the coordinate system definitions in the EPSG geodetic parameter database, rather than the default Easting-Northing (x, y) order. 

This has caused problems for some users of web services, especially those using older versions of GIS applications.

If your geographic features are not where you expected or are rotated 90 degrees then your GIS application may be incorrectly reading the coordinate axis order of the data.

Geodetic Marks Inverted Axis image

Example of a coordinate axis order reversal when using WFS 1.1.0: ArcGIS 10.0 connected to the NZ Government GNSS CORS layer. This layer has a source NZ geographic lat/long coordinate system (NZGD2000).

Specifying the axis order

If you are using an older version of a GIS software package you should upgrade if possible.

If you cannot upgrade, we recommend that you set your WFS version to 1.0.0. This can be done by adding the ‘VERSION’ parameter to your request:

http://data.linz.govt.nz/services;key=YOUR_API_KEY/wfs/layer-LAYER_ID?service=WFS&VERSION=1.0.0

If you require the functionality of WFS 1.1.0 or 2.0 (such as coordinate transformations) and you are having coordinate axis order issues then you can set the axis order explicitly in your request.

Here's an example using Topo500 tracks (NZTM2000) that demonstrates how to deal with the axis order issue for Northing-Easting systems using WFS 2.0:

1. Default (y, x axis order)

By default, your request will return the Northing-Easting (y, x) order for projected coordinate systems such as NZTM2000:

https://data.linz.govt.nz/services;key=YOUR_API_KEY/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=layer-231&count=3

2. Explicitly set (y, x axis order)

This is achieved by setting the SRSNAME parameter to 'urn:x-ogc:def:crs:EPSG:xxxx' to control the output of the spatial reference system:

https://data.linz.govt.nz/services;key=YOUR_API_KEY/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=layer-231&count=3&SRSNAME=urn:x-ogc:def:crs:EPSG:2193

3. Explicitly set (x, y axis order)

This is achieved by setting the SRSNAME parameter to 'EPSG:xxxx':

https://data.linz.govt.nz/services;key=YOUR_API_KEY/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=layer-231&count=3&SRSNAME=EPSG:2193

The axis order reversal also affects WMS between versions 1.1.1 and 1.3.0. If you are having difficulties with your WMS client software follow the same conventions as above to work around the issue.

Read the following resources for more information on this issue:

Source coordinate systems of LDS datasets

This table shows the published coordinate system for LDS datasets and default axis order as interpreted by OGC web services.

Source dataset coordinate system Datasets CRS type EPSG code EPSG axis order WFS 1.0.0 default WFS 1.1.0 default WFS 1.1.0/2.0.0 client issues
WGS84 Hydrographic Geographic 4326 Lat/Long (y, x) Long/Lat (x, y) Lat/Long (y, x) Y
NZGD2000 Property & ownership, Electoral Street Addressing & Geodectic Geographic 4167 Lat/Long (y, x) Long/Lat (x, y) Lat/Long (y, x) Y
NZTM2000 Topographic Mainland

Cartesian/
Projected

2193 NE (y, x) NE (x, y) EN (y, x) N1

Table 1: Coordinate Reference System support and axis order differences between WFS versions 1.0.0 and 1.1.0/2.0.0.

Footnotes

  1. This treatment also applies to all Topographic layers in LDS which have their own Transverse Mercator projection, such as the New Zealand Offshore Island Projections.