Web Feature Services Part 2 – LRIS and LDS
Part 2 of a focus on Web Feature Services (WFS), this time on connecting to data from LRIS and LDS.
A previous post covered the basics of connecting to Web Feature Services (WFS). For this post, we’ll look specifically at how to connect to Landcare’s data portal (LRIS) and the LINZ data service (LDS, not to be confused with the Church of Latter Day Saints…)
When connecting to these services, the basic ideas are the same: we need to connect to a server and provide some information on precisely which data we’re interested in. As we’ve seen previously, both the LRIS and the LDS portals offer web mapping services, Happily, they also offer web feature services so we can get direct access to the data rather than just an image. The difference with these two portals is that we need a “service key” to authorise our access. We’ll first look at how to connect to the LRIS and then look at the LDS.
Create a web service key for LRIS
A web service key is a bit like a password to get you onto a secure website. You’ve got to register your email address and some details with Landcare and then obtain a key, so head to the LRIS site and look for Register at upper right:
Fill in your details on the Register page:
You can then log in to the LRIS site. Once logged in, click on the Dashboard link above the map and then go to the API & Web Services tab – here’s where you can create your own service key.
In this image, I’ve already got one called “LRIS Connection” To create your own, type in a name for your new connection in the Label window, set the Scope to OGC Web Services and click the Accept terms and create key >> button. The key itself is the long string with letters and numbers. Now’s probably a good time to copy that key – we’ll use it in the next step.
Connect to the LRIS server
Next, in ArcCatalog, we’ll set up the connection. As with the CERA connection, we need to use the Data Interoperability extension. (If you haven’t got that installed, contact myself or Paul Helleur at ITS.) In the Catalog tree, navigate down to Interoperability Connections > Add Interoperability Connection:
Double-click on Add Interoperability Connection to open the connection dialogue:
The Format should be set to WFS and the Dataset is http://wfs.lris.scinfo.org.nz/<YOUR-WEB-SERVICE-KEY>/wfs. Copy and paste your web key into the angle bracket space (you don’t need to keep the angle brackets). Then click Parameters…:
Most of these are set automatically but because we’re behind a firewall we need to tick the Use Proxy Server box and fill in your details as above (remember, you can click on the image to get a larger view). Next, click the button under Constraints. All going well you should be presented with the Select Feature Types window:
There’s a lot to choose from. Tick the box next to any of the layers you’re interested in (note the “Select all” box at bottom right – it might take quite a while to load everything and ArcMap could run quite slowly if you do so – not recommended.) I’ll add the Christchurch City Soil Map (x148) just for kicks. Click your way out with the OK buttons and note that there’s a new connection set up in the Catalog tree with an entry for “x148” with a preview on the right (note the coordinates at lower right – this layer is in NZMG):
I can now add this to ArcMap and I’ve got full access to features and attributes and can use this for analysis (or make a local copy if I like):
So, any layer you see on the LRIS portal should be accessible via WFS. Much of what I’ve covered here can also be found on the LRIS page on data streaming.
Connecting to the LINZ Data Service.
The ideas are the same, but you’ll need to create a separate services key with LINZ to get at their data. The registering and dashboards work the same way but the URL you put into the Interoperability connection will be different. I find the LDS more problematic to connect to – it often seems to be hit or miss, so be prepared for some frustration.
Once you’ve got your key, I think the best way to set up this connection is to go back to the main portal page and search for specific layers. In the image below, I’ve added the 1:250,000 scale map sheets to the map and clicked on the link to that layer:
Click on the “Services” tab and scroll down until you can see the one labelled “The following URL provides WFS capabilities for “NZ Topo 250 Map Sheets” and copy it. (One nice thing about the LDS service is that as long as you’re logged your key is automatically inserted into these URLs – the same is true for the LRIS):
Now, in ArcCatalog, start a new Interoperatibility Connection with WFS as the “Format” and the paste the URL you copied from the Services tab into the “Dataset” window and click Parameters. Make sure you’ve got the proxy settings right and click that button in “Constraints”. Here’s what I got (on my second or third try…):
Tick the box of the layers you want and the connection should now be set up. Here’s the preview in ArcCatalog:
I note that the coordinates are NZTM so I’ll add this straight to a map of the coastline so we can see where they all sit.
I got us a copy of the 1:250K map sheets on the J: drive recently with relatively little muss and not much fuss by exporting this layer as a shapefile. There’s a link to some How To documents on the LINZ website but I have yet to make the URL that they recommend to use work -Copying and pasting a URL from the Services tab seems to usually work. LINZ also recommends that you use a separate connection for each layer rather than multiple layers per connection.
So now you’ve seen how to get your hands on the actual data from LINZ and LRIS – very handy, but two caveats:
- Streaming data in from these portals will slow down your map redrawing and any geoprocessing – better to add the data you need and then make yourself a local (potentially clipped) copy;
- To save you’re self any trouble, double-check to make sure we don’t already have a copy of the data you’re after on the J: drive.
There’s a lot of URLs and keys to keep track of in using these services, but keep in mind that even five years ago, this kind of thing was simply not possible.
C