WFS Filtering

Many of the WFS feeds can be quite large. To minimize network traffic, these feeds can be filtered to obtain only the information required.

Property filtering

By default the WFS calls return all attributes for the features requested. However, clients may also use a Property filter to request a subset of the available attributes. The syntax for requesting a subset is as follows: propertyname=field_1,field_2,...,field_n If the propertyname option is present, then only the fields listed in the propertyname arguments will appear in the results. All desired fields must be listed in the arguments. If one or more of the fields listed in the propertyname arguments are invalid an error message will be returned without results.

Bounding box filtering

Additional filtering can be added using the Bounding Box filter. The following shows an example of a Bounding Box filter

&filter=<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml"><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml"><gml:coordinates>-73.99,40.76 -73.92,40.80</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>

Bounding box filters can be entered with their short-hand notation as:


Attribute filtering

Data can also be filtered based on any attribute. One of the most useful attributes to filter on is the update time. The Attribute filter can be added to the end of an WFS call as shown in the example below: