Working with Web Feature Services in hale studio 3.2.0+

Working with Web Feature Services in hale studio 3.2.0+

Tutorials hale»studio Tutorial

With the latest version of hale»studio, we've improved support for Web Feature Services (WFS). Our goal is to make it a fully functional WFS client. In this article, we'll describe those capabilities in detail and outline what limitations there still are - both in hale»studio and in WFS implementations.

hale»studio has several features related to working with Web Feature Services:

  • Read Schema from WFS via DescribeFeatureType operations
  • Read Source Data from WFS via GetFeature operations
  • Write transformed data (or source data) to a transactional WFS via the WFS-T export configurations

hale»studio 3.2.0 Load from WFS

The typical workflow involves these steps:

  1. Go to File -> Import -> Source Schema
  2. Pick the "From WFS" tab
  3. Click on the "..." button to the right of the URL input
  4. Enter the WFS GetCapabilities URL of your service, click "Next"
  5. Pick which types from the WFS you'd like to load, then click "Finish"
  6. Back in the main import dialog, click "Finish" to load the schema

hale»studio 3.2.0 Enter capabilities URL

If you hit an issue during this process, you might need to configure your proxy setup to correctly handle the requests to the WFS. After you've loaded the schema, the next step is to load some data to work with. In this process, you have several options to control what exactly should be loaded, and how.

  1. Go to File -> Import -> Source Data
  2. Pick the "From WFS" tab
  3. Click on the "..." button to the right of the URL input
  4. Enter the WFS GetCapabilities URL of your service, click "Next"
  5. Pick for which types from the WFS you'd like to load data, then click "Next"
  6. You can now set a bounding box for your query by clicking into the map twice, once for the upper left corner, once for the lower right corner. Click "Next" again.
  7. In the final Query definition step, you can decide to limit the number of features retrieved from the WFS. By default, this option is deactivated and the limit is set to 10.000. Click "Finish"

hale»studio 3.2.0 set Bounding Box for WFS

Please note that the integrated GetFeature request builder doesn't support all options of the WFS 2.0 Query conformance class. You can always edit the actual query and paste it into the main import tab. After you've set up the query, you have some more configuration options to control how hale studio will request data from the WFS.

  1. In the main Import Data from WFS tab, click "Next".
  2. If your schema was imported from the same WFS as this data, you can safely leave the first option unchecked. The second option ("order must strictly match the Schema") is usually not required. Creating an instance for the root element is necessary if the root element is not a collection, such as a FeatureCollection.
  3. You can also decide whether hale studio should paginate requests. Instead of requesting all data matching the query in one request, this will instruct hale studio to create smaller requests, e.g. requesting 500 features at a time. In this way, load on both the server and the client is lower, and response time is faster. Request pagination thus allows loading larger datasets from a WFS where previously this may have been limited by a server-side limit of retrievable features per request. There are some limitations to using this feature that we'll talk about below. When you've configured pagination, click "next".
  4. In the next screen, you can define how arc geometries should be handled during import. hale studio doesn't fully support Arcs in its functions, so we provide the option of interpolating them to polygons or linestrings with linear segments. When you've set up interpolation, click "Finish" and let hale studio import the data.
  5. Explore the data via the Source Data view, the Map View, and collect statistics via the Schema Explorer and the the Properties View!

hale»studio 3.2.0 partition WFS requests

There are also some known limitations of using hale studio as a WFS client. Some of these can be fixed by implementing improvements in hale studio and are already on our roadmap, others need to be fixed in the WFS implementations:

  • Pagination will only work if the queried WFS server correctly supports the query parameters required for paging, which is not the case for all WFS 2.0.0 implementations out there.
  • Pagination can work with some WFS 1.x implementations as well. The following implementations support paging via the STARTINDEX parameter also for WFS 1.0 and 1.1:
  • There is some overhead involved when issuing a request to the WFS, so if you set the features per request too low (edge case: 1) you may get worse performance than with a higher value. On the other hand, if the limit is too high you may run into timeouts, e.g. when hale studio times out when reading from a WFS because the response was not returned after a certain amount of time (30 seconds by default).
  • hale studio will never fetch more features than reported by the WFS in the numberMatched attribute. If the WFS does not report the correct number of matched features but instead, for example, a server-side limit of features per request, hale studio will not be able to fetch more features than that.
  • hale studio uses the STARTINDEX parameter defined in WFS 2.0.0 to offset the different requests. If this parameter is not supported, the WFS will always return the same set of features in every request.
  • If the WFS does not report the number of matched features at all and does not support STARTINDEX correctly, hale studio will run into a loop of perpetually fetching the same features.

As explained in the beginning, hale»studio can also write source or transformed features to WFS supporting this. We'll cover this in one of our next posts.