Using WFS spatial filters

Filtering alphanumerical attributes is quite a common task. However, in a GIS application, you may also want to filter features according to geometric properties.

WFS includes a few spatial relationships that you can use to create a spatial filter. From a general point of view, you need an input shape, a relationship to be checked, and some target shapes to be filtered.

In this recipe, we use the DWITHIN spatial relationship to filter countries that are within a circular buffer.

Using WFS spatial filters

Tip

You can find the full source code for this recipe in the code bundle available from the Packt site for this book. Look for the ch01_wfsSpatialFilter.html ...

Get GeoServer Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.