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

PB-987: Add item-search to conformance endpoint #465

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

LukasJoss
Copy link
Contributor

@LukasJoss LukasJoss commented Oct 9, 2024

There are multiple issues with item-search confomance (e.g. timestamps) so for now only feature conformance has been added

def add_landing_page_version(apps, schema_editor):
LandingPage = apps.get_model("stac_api", "LandingPage")
lp = LandingPage.objects.get(version='v1')
lp.conformsTo.insert(2, 'https://api.stacspec.org/v1.0.0/item-search')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we also need to add conformance to https://api.stacspec.org/v1.0.0/collections/?

Copy link
Contributor

@benschs benschs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly we don't fully comply with the "item-search".
We use content-type header application/json instead of application/geo+json, this is to optimize cloudfront.
If we don't care about this we could probably also add "https://api.stacspec.org/v1.0.0/ogcapi-features".

I found https://github.com/stac-utils/stac-api-validator useful to help test our conformance.

@benschs benschs self-requested a review October 14, 2024 07:39
@LukasJoss LukasJoss force-pushed the feat-PB-987-adapt-conformance-endpoint branch from 66048ef to 68e484e Compare October 14, 2024 11:56
@LukasJoss LukasJoss force-pushed the feat-PB-987-adapt-conformance-endpoint branch 2 times, most recently from c22cac3 to 0348d7d Compare October 29, 2024 13:16
@LukasJoss LukasJoss requested review from hansmannj and benschs and removed request for benschs October 29, 2024 13:31
@LukasJoss
Copy link
Contributor Author

@hansmannj there are more problems with conformance for item-search than just the json/geojson stuff so it is probably better to not add that for now

@benschs
Copy link
Contributor

benschs commented Nov 6, 2024

I ran the conformance validator again with the item-search which returned the following errors. I already removed any geojson issues as we decided to ignore them.

The issues are mainly around input validation.
The limit issues seem to be because we only support a max limit of 100, but the spec allows up to 10000. For the datetime parameter I guess we don't parse all input correctly. For the search with bbox and intersects I don't know what the issues are.

- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'limit': 10000} body= had unexpected status code 400 instead of 200: 
- [Item Search] : POST http://localhost:8000/api/stac/v1/search params=None body={"limit": 10000} had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'limit': 100000} body= had unexpected status code 400 instead of 200: 
- [Item Search] : POST http://localhost:8000/api/stac/v1/search params=None body={"limit": 100000} had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'limit': 1000000} body= had unexpected status code 400 instead of 200: 
- [Item Search] : POST http://localhost:8000/api/stac/v1/search params=None body={"limit": 1000000} had unexpected status code 400 instead of 200: 

- [Item Search] : POST http://localhost:8000/api/stac/v1/search params=None body={"bbox": [0, 0, 1, 1], "intersects": {"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}} had unexpected status code 200 instead of 400: Search with bbox and intersects
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'bbox': '100.0,0.0,0.0,105.0,1.0,1.0'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : POST http://localhost:8000/api/stac/v1/search params=None body={"bbox": [100.0, 0.0, 0.0, 105.0, 1.0, 1.0]} had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'bbox': '100.0, 1.0, 105.0, 0.0'} body= had unexpected status code 200 instead of 400: bbox (lat 1 > lat 2)
- [Item Search] : POST http://localhost:8000/api/stac/v1/search params=None body={"bbox": [100.0, 1.0, 105.0, 0.0]} had unexpected status code 200 instead of 400: bbox (lat 1 > lat 2)

- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '/1985-04-12T23:20:50.52Z'} body= had unexpected status code 400 instead of 200: with datetime=/1985-04-12T23:20:50.52Z extracted from an Item
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1985-04-12t23:20:50.000z'} body= had unexpected status code 400 instead of 200: with datetime=1985-04-12t23:20:50.000z extracted from an Item
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1985-04-12'} body= had unexpected status code 200 instead of 400: invalid datetime returned non-400 status code
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1937-01-01T12:00:27.87+0100'} body= had unexpected status code 200 instead of 400: invalid datetime returned non-400 status code
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1985-12-12T23:20:50.52'} body= had unexpected status code 200 instead of 400: invalid datetime returned non-400 status code
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1985-04-12T23:20:50.Z'} body= had unexpected status code 200 instead of 400: invalid datetime returned non-400 status code
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1985-04-12T23:20:50,Z'} body= had unexpected status code 200 instead of 400: invalid datetime returned non-400 status code
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1986-04-12T23:20:50.52Z/1985-04-12T23:20:50.52Z'} body= had unexpected status code 200 instead of 400: invalid datetime returned non-400 status code
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'datetime': '1985-04-12T23:20:50,52Z'} body= had unexpected status code 200 instead of 400: invalid datetime returned non-400 status code

- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "Point", "coordinates": [100.0, 0.0]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "LineString", "coordinates": [[100.0, 0.0], [101.0, 1.0]]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.8, 0.8], [100.8, 0.2], [100.2, 0.2], [100.2, 0.8], [100.8, 0.8]]]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "MultiPoint", "coordinates": [[100.0, 0.0], [101.0, 1.0]]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "MultiLineString", "coordinates": [[[100.0, 0.0], [101.0, 1.0]], [[102.0, 2.0], [103.0, 3.0]]]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "MultiPolygon", "coordinates": [[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]], [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]], [[100.2, 0.2], [100.2, 0.8], [100.8, 0.8], [100.8, 0.2], [100.2, 0.2]]]]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'intersects': '{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [100.0, 0.0]}, {"type": "LineString", "coordinates": [[101.0, 0.0], [102.0, 1.0]]}]}'} body= had unexpected status code 400 instead of 200: 
- [Item Search] : GET http://localhost:8000/api/stac/v1/search params={'collections': 'ch.swisstopo.swissalti3d', 'intersects': '{"type": "Polygon", "coordinates": [[[0, 0], [90, 0], [90, 90], [0, 90], [0, 0]]]}'} body= had unexpected status code 400 instead of 200: 

@hansmannj
Copy link
Member

Thanks for checking!
Fine for me, if we drop it for the moment. What about the https://api.stacspec.org/v1.0.0/collections/ conformance class? Are we conform here and should list it?

@benschs benschs force-pushed the feat-PB-987-adapt-conformance-endpoint branch from 3c78968 to 20a7ac9 Compare November 11, 2024 07:35
@benschs
Copy link
Contributor

benschs commented Nov 11, 2024

@hansmannj yes, we are conform with https://api.stacspec.org/v1.0.0/collections, and it is already set.
Currently the following conformance classes are already set on stac v1:

https://api.stacspec.org/v1.0.0/core
https://api.stacspec.org/v1.0.0/collections
http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core
http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30
http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson

@hansmannj
Copy link
Member

@hansmannj yes, we are conform with https://api.stacspec.org/v1.0.0/collections, and it is already set. Currently the following conformance classes are already set on stac v1:

https://api.stacspec.org/v1.0.0/core
https://api.stacspec.org/v1.0.0/collections
http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core
http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30
http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson

Thanks for checking.
Sorry, misunderstanding, I was thinking of the currently productive v0.9, where it is not yet listed in the conformance endpoint.
But since we will be on v1.0 soon anyways, no need to adapt the old version's conformance endpoint.

Copy link
Member

@hansmannj hansmannj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot 🚀

@benschs benschs merged commit 1e61662 into develop Nov 11, 2024
3 checks passed
@benschs benschs deleted the feat-PB-987-adapt-conformance-endpoint branch November 11, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants