LogoLogo
OS Docs HomeOS NGDOS APIsOS Download ProductsMore than MapsOS Data Hub
  • Introduction to OS APIs
  • Core Concepts
    • Getting started with an API project
    • Authentication
    • Error codes
    • Rate-limiting policy
    • OS API branding
    • Service level agreements
    • Service availability dashboard
  • Accessing OS APIs
    • OS Maps API
      • Layers and styles
      • Getting started
        • ESRI ArcGIS Online
        • ESRI ArcGIS Pro
        • ESRI ArcMap
        • Cadcorp SIS
        • MapInfo Pro
        • QGIS
      • Technical specification
        • ZXY
        • WMTS
      • Code examples
    • OS Vector Tile API
      • What data is available?
      • Getting started
        • ESRI ArcGIS Pro
        • Cadcorp SIS
        • QGIS
        • Create a web application using the OS Vector Tile API
      • Technical specification
        • Service Metadata
        • Stylesheet
        • Tile request
      • Code examples
      • Stylesheets
    • OS NGD API – Tiles
    • OS NGD API – Features
    • OS Features API
      • OS Product Archive
      • What data is available?
      • Getting started
        • ArcGIS Online
        • ArcGIS Pro
        • ArcMap
        • Cadcorp SIS
        • MapInfo Pro
        • QGIS
      • Technical specification
        • getCapabilities
        • describeFeatureType
        • getFeature
        • Filtering
        • Paging
        • Empty values
      • Code examples
    • OS Names API
      • Getting started with example queries using Node.js
      • Technical specification
        • Find
        • Nearest
      • Code list
      • Code examples
    • OS Linked Identifiers API
      • What data is available?
      • Getting started with implementing a look-up application
      • Technical specification
        • Identifier
        • Identifier Types
        • Feature Types
        • Product Version Information
      • Code examples
    • OS Places API
      • Getting started with example queries using Node.js
      • Technical specification
        • Find
        • Postcode
        • UPRN
        • Nearest
        • BBOX
        • Radius
        • Polygon
      • Datasets
      • Code lists
      • Code examples
    • OS Match & Cleanse API
      • End of Life Information
      • Getting started with an example match query using Node.js
      • Technical specification
      • Datasets
      • Code lists
    • OS Downloads API
      • Getting started
        • Automating OS OpenData downloads
        • Automating OS Premium data downloads
      • Technical specification
        • OpenData products
        • OpenData product details
        • Download an OpenData product
        • OpenData product image
        • Data packages
        • Data package ID
        • Data package version
        • Data package version ID
        • Download a data package
    • OAuth 2 API
      • Getting started
      • Technical specification
  • Additional resources
    • OS API Wrappers
      • JavaScript
      • Python
      • R
  • Extra Links
    • Accessibility
    • Contact us
    • PSGA Product Summary
    • Terms and conditions
Powered by GitBook
On this page

Was this helpful?

  1. Accessing OS APIs
  2. OS Features API
  3. Technical specification

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>

Note:

If you want to combine both a bounding box and another filter each should be included in a single OGC filter parameter. If you combine a purely attribute-based OGC filter (as above) with a bounding box via the bbox request parameter, the bbox request parameter takes precedence and the attribute filter is ignored.

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>
PreviousgetFeatureNextPaging

Last updated 1 year ago

Was this helpful?