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

Reading Data from the STAC API - does not work if you follow the instructions exactly #345

Open
douglasmacdonald opened this issue May 19, 2024 · 1 comment

Comments

@douglasmacdonald
Copy link

douglasmacdonald commented May 19, 2024

With reference to the following link

https://planetarycomputer.microsoft.com/docs/quickstarts/reading-stac/

Issue 1

The following does not explain why pip is used and not mamba as previously recommended.

python -m pip install pystac-client.

Plus, there is no mention of installing planetary_computer.

import pystac_client
import planetary_computer

catalog = pystac_client.Client.open(
    "https://planetarycomputer.microsoft.com/api/stac/v1",
    modifier=planetary_computer.sign_inplace,
)

Error

ModuleNotFoundError                       Traceback (most recent call last)
      1 import pystac_client
----> 2 import planetary_computer
      4 catalog = pystac_client.Client.open(
      5     "https://planetarycomputer.microsoft.com/api/stac/v1",
      6     modifier=planetary_computer.sign_inplace,
      7 )

ModuleNotFoundError: No module named 'planetary_computer'

Solution

I can't comment as I don't know if you want to use pip or mamba.

Issue 2

time_range = "2020-12-01/2020-12-31"
bbox = [-122.2751, 47.5469, -121.9613, 47.7458]

search = catalog.search(collections=["landsat-c2-l2"], bbox=bbox, datetime=time_range)
items = search.get_all_items()
len(items)

Warning

FutureWarning: get_all_items() is deprecated, use item_collection() instead.

Issue 3

Another pip/mamba install is missing from the text.

import contextily

ModuleNotFoundError: No module named 'contextily'

Solution

Again, I don't know if you want to use mamba or pip.

@TomAugspurger
Copy link

Thanks for opening the issue. We can update the first snippet to recommend installing both pystac-client & planetary-computer.

I'll hold off on adding contextily, since that isn't strictly necessary for core features being shown there.

I don't know if you want to use mamba or pip.

That would be up to the user.

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