-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
✨ PySTACAPISearchIterDataPipe to query dynamic STAC Catalogs #59
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python client for STAC Catalogs and APIs!
An iterable-style DataPipe to make STAC API queries! Uses pystac-client to perform the STAC API Item Search. Included a doctest that does a STAC API search which returns an iterable list of STAC item objects. Added a new section in the API docs and an intersphinx mapping.
Ensure that a spatiotemporal query can be made to a STAC API /search/ endpoint to produce an instance of a pystac_client.ItemSearch object containing pointers to multiple pystac.Item objects. Also removed a for-loop that was accidentally added after a yield statement.
Decided that it is cleaner to pass in all the STAC API query parameters via the source_datapipe, rather than through both the source_datapipe and kwargs. The kwargs can then be kept for keyword arguments into pystac.Client.open. Documented some example parameters for pystac_client.Client.search and pystac_client.Client.open. Updated the unit test and doctest, adding a teaser way to sign planetary_computer assets inplace too!
weiji14
commented
Sep 16, 2022
>>> dp = IterableWrapper(iterable=[query]) | ||
>>> dp_pystac_client = dp.search_for_pystac_item( | ||
... catalog_url="https://planetarycomputer.microsoft.com/api/stac/v1", | ||
... # modifier=planetary_computer.sign_inplace, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out this modifier
parameter (see also stac-utils/pystac-client#259) because
- It's a (cool) new feature done in Add a post-init modifier keyword stac-utils/pystac-client#286, released in
pystac-client=0.5.0
, but we don't want to pin to a particular pystac-client version. - It requires the
planetary-computer
library to be installed, specifically version 0.4.7+ which includes Feature/sign inplace microsoft/planetary-computer-sdk-for-python#42
So leaving this as an easter egg 🥚 for now, but will include it in the next walkthrough tutorial.
3 tasks
Ensure that parameters such as authentication keys can be passed to pystac_client.Client.open. Using a fake API key for Radiant MLHub, which can only take us so far as to getting a title and description.
Fix Continuous Integration failure because jsonschema had to be installed but it is an optional dependency.
Bump oauthlib from 3.2.0 to 3.2.1
Move pystac and pystac-client to a dedicated `stac` extras section for spatiotemporal dependencies! Also updated index page with instructions on installing these STAC dependencies.
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An iterable-style DataPipe to make STAC API queries to dynamic STAC Catalogs! Uses pystac-client to perform the STAC API Item Search on the
/search
endpoint.Preview at https://zen3geo--59.org.readthedocs.build/en/59/api.html#zen3geo.datapipes.PySTACAPISearch
Usage (requires
planetary-computer>=0.4.7
andpystac-client>=0.5.0
):TODO:
pystac_client.Client.open
pystac_client.Client.open
workspystac-client
as a dependency and not bothpystac
andpystac-client
?Ensure that(actually no, becauseSTAC_URL
environment variable worksSTAC_URL
no longer works, see remove STAC_URL stac-utils/pystac-client#81, patch update at Remove mention of STAC_URL in Client.open docstring stac-utils/pystac-client#317)Part of #48.
References: