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

stac-client cli: how to use it for ms-buildings collections? #565

Closed
aborruso opened this issue Jul 20, 2023 · 6 comments
Closed

stac-client cli: how to use it for ms-buildings collections? #565

aborruso opened this issue Jul 20, 2023 · 6 comments

Comments

@aborruso
Copy link

Hi,
in the cli tutorial, I have this kind of example for sentinel-2-l2a collection:

stac-client search https://earth-search.aws.element84.com/v1 -c sentinel-2-l2a --bbox -72.5 40.5 -72 41 --matched

I would like to use the cli, to query ms-buildings collection, but what's the URL I must use for it? Where can I find it? Where is the documentation about it?

Thank you

@jsignell
Copy link
Member

The docs on the ms-buildings collection are here: https://planetarycomputer.microsoft.com/dataset/ms-buildings#Example-Notebook. They go though how to use the python pystac-client API to access ms-buildings. To use the CLI you would replace the earth-search STAC URL (https://earth-search.aws.element84.com/v1) with the planetary computer STAC URL (https://planetarycomputer.microsoft.com/api/stac/v1) and the collection (sentinel-2-l2a) with 'ms-buildings'. For instance:

stac-client search https://planetarycomputer.microsoft.com/api/stac/v1 -c ms-buildings --bbox 30 20 34 22

@aborruso
Copy link
Author

You are very kind, thank you.

I have used this command for my bbox and it works

stac-client search https://planetarycomputer.microsoft.com/api/stac/v1 -c ms-buildings --bbox 46.40 24.52 47.110 25.165

Now I have my token and I know that I would like to download the stac id KingdomofSaudiArabia_123022211_2023-04-25.

Is there a way to do via some cli? Could I use some abfs tool to do it?

Thank you again

image

@jsignell
Copy link
Member

To download the asset you can use the relatively new stac-asset CLI. You can read about that here: https://github.com/stac-utils/stac-asset

@aborruso
Copy link
Author

thank you very much @jsignell

@aborruso
Copy link
Author

@jsignell I have tried to run this

stac-client search https://planetarycomputer.microsoft.com/api/stac/v1 -c ms-buildings --bbox 46.40 24.52 47.110 25.165 --max-items 1 | stac-asset download

and I have this error

stac_asset.errors.DownloadError: error when downloading asset 'data' with href 'abfs://footprints/delta/2023-04-25/ml-buildings.parquet/RegionName=KingdomofSaudiArabia/quadkey=123022211': cannot read a file with the filesystem client if it has a url scheme: abfs://footprints/delta/2023-04-25/ml-buildings.parquet/RegionName=KingdomofSaudiArabia/quadkey=123022211

Do you want me to open an issue in stac-asset repo?

Thank you

@jsignell
Copy link
Member

yeah that would be great if you could open an issue over in that repo and refer back to this one.

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