Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature collection filtering by properties with enumeration missing #61

Open
buildvoc10 opened this issue Sep 24, 2023 · 1 comment
Open

Comments

@buildvoc10
Copy link

Good afternoon

  1. Have deployed OS NGD API – Features Retrieve items from a feature collection, I noticed that https://labs.os.uk/public/osngd/os-ngd-api-features/examples/queryables.html has the filters built into query, how do I update my app to include these filters?
    image

  2. Where in the code do I change the location of bbox? (greyed out)
    image

Thanks for making code open source really helpful in development of building-height.co.uk
Building-Height is a system that can determine the attributes of historical buildings in England. The building part can be defined just by uploading a photo.
If you would like to try the app here is a link to an example image in Farnham, Surrey. (currently only have a couple thousand OS polygons footprints in our database for testing.

@tmnnrs
Copy link

tmnnrs commented Jun 28, 2024

Hi @buildvoc10. Thanks for the feedback (and glad to hear that the resources have been helpful).

You will probably be interested in the /queryables endpoint for the service. This defines which properties can be filtered for the requested feature collection (using the filter query parameter). The examples demonstrate how to filter by the properties with enumerated values (however you can also filter by text strings or integers). You might find that https://labs.os.uk/public/osngd/tutorials/filtering-and-cql is a useful resource to better help understand filtering using CQL.

The bounding box (BBOX) can be defined using the bbox query parameter. For the purpose of the examples we have disabled this option to use a predefined/restricted extent; but in practice the value would be important in limiting your responses to the area of interest (otherwise features will be returned across the whole of GB).

Using theosdatahub-js wrapper you can implement the filter and bbox query parameters as follows: osdatahub.ngd.features("INSERT_API_KEY_HERE", "bld-fts-buildingpart", { bbox: [-3.545022,50.727083,-3.538596,50.728095], filter: "description = 'Building'", limit: 1000 })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants