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 broken in latest release #320

Closed
benjimin opened this issue Sep 20, 2021 · 5 comments
Closed

STAC broken in latest release #320

benjimin opened this issue Sep 20, 2021 · 5 comments

Comments

@benjimin
Copy link
Contributor

benjimin commented Sep 20, 2021

Explorer is supposed to have some support for STAC queries. Apparently this worked previously but is broken in the most recent release.

Using: pystac-client:

$ stac-client collections http://explorer.dea.ga.gov.au/stac

JSON does not represent a STAC object.

Using odc-tools:

$ stac-to-dc --catalog-href=https://explorer.dea.ga.gov.au/stac/ --collections=wofs_albers --bbox=35,-26,36,-25 --limit=10

pystac.errors.STACTypeError: JSON does not represent a STAC object.

According to @alexgleith this worked last week but not now:

stac-to-dc --catalog-href=https://explorer.digitalearth.africa/stac/ --collections=s1_rtc --bbox=35,-26,36,-25 --limit=10
@benjimin
Copy link
Contributor Author

benjimin commented Sep 20, 2021

Related: would be great to have more stac tests (#258 & #304) to catch this kind of thing.

Possibly related to latest stac release (#303)? (Or a nonstandard implementation confusing the client library? #181)

@alexgleith
Copy link
Contributor

Full error is: stac-to-dc --catalog-href=https://explorer.digitalearth.africa/stac/ --collections=s1_rtc --bbox=35,-26,36,-25 --limit=10

Traceback (most recent call last):
  File "/usr/local/bin/stac-to-dc", line 33, in <module>
    sys.exit(load_entry_point('odc-apps-dc-tools', 'console_scripts', 'stac-to-dc')())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/alex/git/opendatacube/odc-tools/apps/dc_tools/odc/apps/dc_tools/stac_api_to_dc.py", line 250, in cli
    added, failed = stac_api_to_odc(
  File "/Users/alex/git/opendatacube/odc-tools/apps/dc_tools/odc/apps/dc_tools/stac_api_to_dc.py", line 125, in stac_api_to_odc
    client = Client.open(catalog_href)
  File "/usr/local/lib/python3.9/site-packages/pystac_client/client.py", line 61, in open
    cat = cls.from_file(url, headers=headers)
  File "/usr/local/lib/python3.9/site-packages/pystac_client/client.py", line 78, in from_file
    cat = super().from_file(href, stac_io)
  File "/usr/local/lib/python3.9/site-packages/pystac/catalog.py", line 1010, in from_file
    result = super().from_file(href, stac_io)
  File "/usr/local/lib/python3.9/site-packages/pystac/stac_object.py", line 478, in from_file
    o = cls.from_dict(d, href=href, migrate=True, preserve_dict=False)
  File "/usr/local/lib/python3.9/site-packages/pystac/catalog.py", line 958, in from_dict
    info = identify_stac_object(d)
  File "/usr/local/lib/python3.9/site-packages/pystac/serialization/identify.py", line 241, in identify_stac_object
    raise pystac.STACTypeError("JSON does not represent a STAC object.")
pystac.errors.STACTypeError: JSON does not represent a STAC object.

@jeremyh
Copy link
Collaborator

jeremyh commented Sep 20, 2021

Ouch. We're testing validation against the official Stac shema for collections, dataset etc... but somehow not on the root "/stac" document, which is the first thing the client tries to load. It's missing the new type: catalog attribute.

@jeremyh
Copy link
Collaborator

jeremyh commented Sep 20, 2021

Enabled validation in #321

@benjimin
Copy link
Contributor Author

$ stac-client collections http://explorer.dev.dea.ga.gov.au/stac
ConformanceClasses.COLLECTIONS not supported

hmm...

@jeremyh jeremyh closed this as completed Sep 22, 2021
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

3 participants