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

Use OAFeat items endpoint for get_item #136

Closed
duckontheweb opened this issue Feb 2, 2022 · 2 comments · Fixed by #166
Closed

Use OAFeat items endpoint for get_item #136

duckontheweb opened this issue Feb 2, 2022 · 2 comments · Fixed by #166
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@duckontheweb
Copy link
Collaborator

duckontheweb commented Feb 2, 2022

The CollectionClient class relies on the inherited Collection.get_item method to fetch an Item by ID. This results in looping over all the Items in the Collection until the one with the correct ID is found, which can be extremely inefficient for large collections. For example, using CollectionClient.get_item to fetch the ref_landcovernet_v1_source_35KNT_04_20180105 Item from the the ref_landcovernet_v1_source Collection in Radiant MLHub is still running after 10 minutes for me.

The OGC API - Features spec provides a /collections/{collection_id}/items/{item_id} endpoint that can be used to fetch an Item directly by ID. Making a request for the example Item above using this endpoint resolves in under a second.

It seems worthwhile for CollectionClient to override the inherited get_item method to use this endpoint if the proper conformance classes are present and fall back to using the inherited method if they are not.

@duckontheweb duckontheweb added the enhancement New feature or request label Feb 2, 2022
@duckontheweb
Copy link
Collaborator Author

cc: @KennSmithDS

@matthewhanson
Copy link
Member

Thanks @duckontheweb , we will add a CollectionClient.get_item function in the next release.

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

Successfully merging a pull request may close this issue.

3 participants