Filtering
The OS Features API service accepts standard OGC XML filter parameters and can be applied following the normal OGC filter structure. When constructing an attribute-based filter, any attribute returned in the DescribeFeatureType
response is a valid candidate.
For example, to return all Topography_TopographicArea
features with a DescriptiveGroup
of Roadside
, a user would submit a GetFeature
request with a typeNames
parameter of Topography_TopographicArea
, and a filter
parameter like this:
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>DescriptiveGroup</ogc:PropertyName>
<ogc:Literal>Roadside</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
A combined bounding box and attribute filter might look something like this:
<ogc:Filter>
<ogc:And>
<ogc:Within>
<PropertyName>SHAPE</PropertyName>
<gml:Box xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:27700">
<gml:coordinates decimal="." cs="," ts=",">
436833.50,115334.90,437643.25,115761.50
</gml:coordinates>
</gml:Box>
</ogc:Within>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>DescriptiveGroup</ogc:PropertyName>
<ogc:Literal>Roadside</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:And>
</ogc:Filter>
Last updated
Was this helpful?