Skip to main content

Accessing the Trap.NZ map feeds with QGIS

Accessing layers

You can add a WFS Layers Layer > Add Layer > Add WFS Layerimage-1639610470879.png

 

Create a new Server Connection and enter the WFS URL in the format described here
https://io.trap.nz/geo/trapnz-projects/wfs/apikey/project_id

The WFS server is set to return a maximum of 10k features per request. If you have more than this number of features you must enable paging and set a page size less than 10,000.  We recommend 5000.

image-1639615373973.png

Save and then click Connect to see the available layers:
image-1639615716385.png

You can then add individual or groups of layers to the map.

Filtering records

You can add a CQL filter to a WFS connection to filter features from the WSF server. This can greatly reduce the amount of data retrieved (speeding up the transfer and improving performance).

For example - if you are only interested in this year’s records, you could add a CQL filter to build the query as a filter before loading the layer from the server.

1. Connect to the server as above to see the list of available layers.

2. Select the layer you want to query (e.g. default-project-trap-records) and click the Build query button

3. In the dialog that appears, enter the following SELECT * FROM "default-project-trap-records" WHERE record_date > '2021-01-01'  (or whatever date you wish to use)
image-1639617358583.png

4. Press OK. The expression used will appear as the Sql value of the target layer:
image-1639617522593.png

When you add the layer now, only the filtered records (features) will be loaded.