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.

Changeset URL syntax

Understand the request parameters of the LDS Changeset API.

Requests

The Changeset API leverages the LDS Web Feature Service. The default version for this service is WFS 2.0. The API supports WFS HTTP GET requests including the following operations:

  • GetCapabilities: returns metadata and valid WFS operations and parameters about the changeset.
  • GetFeature: returns features from the changeset.

The URL request parameters for the Changeset API and the standard LDS WFS differ in 2 ways:

  1. The layer identifier is appended with the parameter '–changeset', for example 'table-52067-changeset' or 'layer-50804-changeset'
  2. Additional 'from' and 'to' timestamp parameters are required to specify the range of time to return changes between.

You can also apply standard WFS filtering operations to your request if you want to return changeset data for a specific locality or for specific attributes.

GetCapabilities request

The base GetCapabilities URL for the Changeset API has the following variables:

https://data.linz.govt.nz/services;key=YOUR_API_KEY/wfs/layer-LAYER_ID-changeset?SERVICE=WFS&VERSION=VERSION_NUMBER&REQUEST=GetCapabilities&viewparams=from:TIMESTAMP;to:TIMESTAMP

  • YOUR_API_KEY – your LDS API key
  • LAYER_ID – the identifier of the LDS dataset
  • VERSION_NUMBER – the WFS version
  • TIMESTAMP – the time range to return changes between.

For aspatial tables, the ‘layer-LAYER_ID-changeset’ parameter is replaced by ‘table-TABLE_ID-changeset'.

GetFeature request

The GetFeature URL for the Changeset API has the same variables:

https://data.linz.govt.nz/services;key=YOUR_API_KEY/wfs?SERVICE=WFS&VERSION=VERSION_NUMBER&REQUEST=GetFeature&typeNames=layer-LAYER_ID-changeset&viewparams=from:TIMESTAMP;to:TIMESTAMP

Changeset API GetFeature request example

This example makes a WFS 2.0.0 GetFeature request for the NZ Property Titles layer change-set between 15 August 2018 and 25 August 2018, limited to 4 features and output as a CSV file:

https://data.linz.govt.nz/services;key=YOUR_API_KEY/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&typeName=layer-50804-changeset&viewparams=from:2018-08-15;to:2018-08-25&count=4&outputformat=csv

Output format

When requested through the changeset generator on LDS, your changeset is requested using a WFS GetFeature URL with CSV specified as the output format. Other output formats are listed in the table below.

FormatURL parameter syntaxNotes
GML2&outputFormat=GML2Default for WFS 1.0.0
GML3&outputFormat=GML3Default for WFS 1.1.0 and WFS 2.0
JSON&outputFormat=json 
CSV&outputFormat=csvGeometry in WKT format
KML&outputFormat=kml 

See our guide on how to use the Changeset generator for more options for accessing changeset data.