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

Collection bbox filtering from stac-browser #476

Closed
carderne opened this issue Oct 6, 2022 · 2 comments
Closed

Collection bbox filtering from stac-browser #476

carderne opened this issue Oct 6, 2022 · 2 comments
Labels
api layer enhancement New feature or request pgstac spec Compliance with STAC/OGC specifications sqlalchemy

Comments

@carderne
Copy link
Contributor

carderne commented Oct 6, 2022

The collection-level filter in stac-browser makes a request that looks like:

/collections{collection_id}/items?bbox=1,2,3,4

But the bbox query param is ignore in that route in stac-fastapi.pgstac. Eg this request to the MS PC API, which returns an Item nowhere near the requested bbox.

The route called doesn't do anything with the bbox:

req = self.post_request_model(
collections=[collection_id], limit=limit, token=token
)
item_collection = await self._search_base(req, **kwargs)

As far as I can tell this is not an issue on stac-browser's side. Would appreciate some help understanding how this is supposed to work, because it seems like there's more going on that just adding bbox to the queries passed to _search_base? If not I'm happy to work on a PR to do that...

@geospatial-jeff
Copy link
Collaborator

geospatial-jeff commented Oct 6, 2022

Same as #380

The bbox and datetime query parameters on the /items endpoint are part of OGC API - Features (OAF) and not currently supported by stac-fastapi. Note that STAC extends OAF, but they are two different specifications. It would be really nice to support them though because this has caused some confusion (as mentioned in #380 ). PRs are more than welcome! 😄

In order to implement this:

  • This class defines the query parameters accepted by the /items endpoint. Add bbox and datetime.
  • Update the abstract base classes (here and here) to accept optional bbox and datetime arguments. This will allow the backend clients to accept these query parameters.
  • Update the backend implementations to implement the two new parameters.
    • The sqlalchemy backend will support this, I'd recommend starting there.
    • This may require a change to pgstac, @bitner @vincentsarago would know more.

You can find more information about how bbox and datetime should be implemented here:

@carderne carderne mentioned this issue Oct 6, 2022
4 tasks
@geospatial-jeff geospatial-jeff added spec Compliance with STAC/OGC specifications api layer pgstac sqlalchemy labels Oct 6, 2022
@carderne
Copy link
Contributor Author

carderne commented Oct 6, 2022

Thanks I didn’t find that duplicate issue somehow. Will dig into this tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api layer enhancement New feature or request pgstac spec Compliance with STAC/OGC specifications sqlalchemy
Projects
None yet
Development

No branches or pull requests

3 participants