Introduction
What is going to expect you
Last updated
What is going to expect you
Last updated
This tutorial will show you how to use filter expressions in FME in order to query OGC Web Feature Services (WFS).
The relevant Filter Encoding Standard is developed by OGC and ISO TC/211. This standard describes a key value pair (KVP) system using XML documents.
FME supports all versions of WFS, i.e. versions 1.x, 2.x and 3.x also known as OGC API - FEATURES. So why could it be necessary to use filter expressions? What is the benefit comparing to FME standard functionality?
The answer is: most WFS services are limited to a certain number of features, normally to 10.000 or 30.000 features.
Imagine you want to use a WFS delivering cadastral parcels and you only need one or a small number of cadastral parcel features. Let's say you're using the cadastral parcel WFS of North Rhine-Westphalia which actually holds available more than 9.000.000 features. How to get the one feature with cadastral parcel number "05430202600946______"?
One possible strategy could be to download the whole bunch to your local hard drive first (good luck!) and to do the selection in a second step for example using FMEs TestFilter transformer.
A more effective way could be to ask the WFS for the concrete features you need. This saves time, network traffic and local disk space.
Asking a system for a subset of data ... this reminds you of something known?
Yes, you're right! Think about SQL (Structured Query Language). SQL is a standard language for storing, manipulating and retrieving data in databases. To query a database for a concrete dataset you'll use the key value pair "attribute = value", e.g.
Filter expressions are working the same way: they use key value pairs.
These keys can be:
attributes
spatial operators
a combination of both (attributive and spatial)
The difference to SQL is: filter expressions are written in XML (Don: we still love XML!). A key value pair may look like this:
You may wonder about how this could work? Something is missing ...
Indeed: we need an operator or function like the equal sign "=" in SQL.
PropertyIsEqualTo is the equivalent to "=" in SQL.
But before we're diving into the deep, I've to express my gratitude to some people.