Web Feature Services (WFS) are a great way of accessing GIS resources over the web without the need to download static files. The WFS Standard provides an interface for allowing requests for geographical features across the web, using platform-independent calls. As opposed to Web Map Services (WMS), Web Feature Services gives you access to the actual data which drive maps, and not just display it.

    FME and the WFS Reader
    FME has a WFS reader enabling a connection to Web Feature Services. You can input the URL, use authentication (if required), and configure the reader to use the WFS for whatever way you need it.

    Performance
    One of the main issues you can face when using a WFS is accessing large datasets. Try some of these tips to limit the features you pull from the server, to ensure a stable connection that you can rely on.

    Geographic Filter
    If you’re only trying to access features within a certain geographic extent, you can apply a bounding box on the reader, to only return features within your extent. This works particularly well if you’re a local government with a constant area of interest, or pulling features from an international service but are only interested in data for New Zealand.

    Attribute Filter Expressions
    Alternatively if you’re interested in a specific set of data which you can define using an attribute, you can enter this in the WFS parameters. This is particularly useful if you’re looking for data within a certain date range.

    Multipart Transfer
    Sometimes it’s not possible to  filter data using an attribute, or if you’re trying to access a table there’s no geographic extent to limit your features by.  When accessing very large datasets, this can cause issues with connection timeouts and lead to an unstable process. Using the WFS Reader’s constraints, you can make multiple requests to the WFS in order to pull smaller and more manageable chunks of data which make up a complete dataset. By setting the Count field to a smaller number, rather than asking for the entire dataset in a single request, FME batches up the requests based on your count size.

    Web Feature Services (WFS) are a great way of accessing GIS resources over the web without the need to download static files. The WFS Standard provides an interface for allowing requests for geographical features across the web, using platform-independent calls. As opposed to Web Map Services (WMS), Web Feature Services gives you access to the actual data which drive maps, and not just display it.

    FME and the WFS Reader
    FME has a WFS reader enabling a connection to Web Feature Services. You can input the URL, use authentication (if required), and configure the reader to use the WFS for whatever way you need it.

    Performance
    One of the main issues you can face when using a WFS is accessing large datasets. Try some of these tips to limit the features you pull from the server, to ensure a stable connection that you can rely on.

    Geographic Filter
    If you’re only trying to access features within a certain geographic extent, you can apply a bounding box on the reader, to only return features within your extent. This works particularly well if you’re a local government with a constant area of interest, or pulling features from an international service but are only interested in data for New Zealand.

    Attribute Filter Expressions
    Alternatively if you’re interested in a specific set of data which you can define using an attribute, you can enter this in the WFS parameters. This is particularly useful if you’re looking for data within a certain date range.

    Multipart Transfer
    Sometimes it’s not possible to  filter data using an attribute, or if you’re trying to access a table there’s no geographic extent to limit your features by.  When accessing very large datasets, this can cause issues with connection timeouts and lead to an unstable process. Using the WFS Reader’s constraints, you can make multiple requests to the WFS in order to pull smaller and more manageable chunks of data which make up a complete dataset. By setting the Count field to a smaller number, rather than asking for the entire dataset in a single request, FME batches up the requests based on your count size.

    Using these constraints, a request is sent to the server for only features 1-5000. After this request is made, another will be made for features 5001-10,000 – and so on until the entire dataset is received. By using this method, smaller requests to the service are much more reliable, resulting in a more stable process with greatly reduced risk of timeout errors.

    Did you know?… The LINZ Data Service has support for WFS on it’s datasets. This can save you plenty of time by taking away the need to download datasets manually, and allows for fully automated updates using FME as your ETL tool.

    On the LINZ data service, check out the Services tab on any of the datasets you need to download on a regular basis. Using some of the tips and tricks above, you can set up FME workspaces to run on a regular schedule, pulling only the data that you and your organization need, when you need it.  Read more about how to use the LINZ WFS.

    Read more on the FME Web Feature Service reader

    Article Author:
    Kieran O’Donnell
    FME Data Solutions
    Locus