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

Does not represent a CollectionClient instance error when running stac-client collections #129

Closed
robintw opened this issue Jan 5, 2022 · 2 comments

Comments

@robintw
Copy link

robintw commented Jan 5, 2022

I'm the author of #113, and am trying to check that bug is fixed. However, I seem to have run into another issue - but I don't know whether it is a pystac-client issue, a pystac issue or a stac-fastapi issue. I hope someone here might be able to work out where the bug is and then I can submit an issue at the right place.

When running:

stac-client collections http://robin-stac-fastapi-test.azurewebsites.net

I get the following output:

{'id': 'joplin', 'type': 'collection', 'links': [{'rel': 'items', 'type': 'application/geo+json', 'href': 'https://robin-stac-fastapi-test.azurewebsites.net/collections/joplin/items'}, {'rel': 'parent', 'type': 'application/json', 'href': 'https://robin-stac-fastapi-test.azurewebsites.net/'}, {'rel': 'root', 'type': 'application/json', 'href': 'https://robin-stac-fastapi-test.azurewebsites.net/'}, {'rel': 'self', 'type': 'application/json', 'href': 'https://robin-stac-fastapi-test.azurewebsites.net/collections/joplin'}], 'extent': {'spatial': {'bbox': [[-94.6911621, 37.0332547, -94.402771, 37.1077651]]}, 'temporal': {'interval': [['2000-02-01T00:00:00Z', '2000-02-12T00:00:00Z']]}}, 'license': 'public-domain', 'description': 'This imagery was acquired by the NOAA Remote Sensing Division to support NOAA national security and emergency response requirements. In addition, it will be used for ongoing research efforts for testing and developing standards for airborne digital imagery. Individual images have been combined into a larger mosaic and tiled for distribution. The approximate ground sample distance (GSD) for each pixel is 35 cm (1.14 feet).', 'stac_version': '1.0.0'} does not represent a CollectionClient instance

The key bit seems to be the last bit: does not represent a CollectionClient instance.

The URL is a deployment of stac-fastapi that I've set up, and it seems to work fine with every other tool I've used it with. That makes me think that this might be a problem in pystac-client or pystac - but as I said above, I'm not sure, and I'm happy to be corrected.

I'm happy for you to look at the URL and browse the JSON returned to try and debug this - but I'm not quite sure how to debug it myself (I got very lost in the pystac/pystac-client code last time I tried).

Any ideas would be much appreciated.

@gadomski gadomski self-assigned this Jan 5, 2022
@gadomski
Copy link
Member

gadomski commented Jan 5, 2022

This appears to be an issue with the STAC Catalog you've set up at http://robin-stac-fastapi-test.azurewebsites.net -- the collection with id == "joplin" has an incorrect type field (notice the lowercase "collection"):

Screen Shot 2022-01-05 at 6 35 52 AM

However, it's hard to know that from the error message -- I've opened #130 to capture that difficulty.

@gadomski gadomski removed their assignment Jan 5, 2022
@robintw
Copy link
Author

robintw commented Jan 5, 2022

Great - that's really helpful @gadomski, thank you. Thanks for creating the issue for more informative error messages too.

I think that joplin collection came from the sample data provided with stac-fastapi. I'll check that, and if so, I'll raise an issue there.

robintw added a commit to robintw/stac-fastapi that referenced this issue Jan 6, 2022
The STAC API states that collections must have a 'type' of 'Collection', but the example data had a collection with a type of 'collection' which caused various other tools to fail when processing this collection (see stac-utils/pystac-client#129)
@gadomski gadomski closed this as completed Jan 6, 2022
moradology added a commit to stac-utils/stac-fastapi that referenced this issue Jan 12, 2022
* Change type of example collection to 'Collection'

The STAC API states that collections must have a 'type' of 'Collection', but the example data had a collection with a type of 'collection' which caused various other tools to fail when processing this collection (see stac-utils/pystac-client#129)

* Update Changelog

Co-authored-by: Nathan Zimmerman <npzimmerman@gmail.com>
gadomski pushed a commit to stac-utils/stac-fastapi-pgstac that referenced this issue Mar 22, 2023
* Change type of example collection to 'Collection'

The STAC API states that collections must have a 'type' of 'Collection', but the example data had a collection with a type of 'collection' which caused various other tools to fail when processing this collection (see stac-utils/pystac-client#129)

* Update Changelog

Co-authored-by: Nathan Zimmerman <npzimmerman@gmail.com>
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