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

Item bbox field should be nullable in the sqlalchemy backend #350

Closed
yellowcap opened this issue Feb 18, 2022 · 2 comments
Closed

Item bbox field should be nullable in the sqlalchemy backend #350

yellowcap opened this issue Feb 18, 2022 · 2 comments

Comments

@yellowcap
Copy link
Contributor

Problem

I have some trouble with the item bbox field when ingesting STAC items that have a null value on the geometry field. The STAC spec allows the item bbox to be null, when the geometry field is null, but in the sqlalchemy backend the bbox is not nullable.

Example STAC Item with a null geometry and no bbox

I came across this problem when trying to ingest STAC Item data from the usgs-landsat stac api.

In this api, there are some items that have geometry set to null and omit the bbox field. Here is a link to an example:

https://landsatlook.usgs.gov/stac-server/collections/landsat-c2l3-ba/items/LE07_CU_002012_20150101_20210502_02_BA

Proposed solution

I would like to propose to make the bbox field nullable in the items table. This would increase the compliance with the STAC spec.

@geospatial-jeff
Copy link
Collaborator

@yellowcap Good catch! We'll have to start with an upstream change to stac-pydantic, I created an issue there!

@yellowcap
Copy link
Contributor Author

Excellent, thanks @geospatial-jeff . I had a go at the stac-pydantic change. But I think that we need to go one layer up, as the geometry field is defined in geojson-pydantic here: https://github.com/developmentseed/geojson-pydantic/blob/master/geojson_pydantic/features.py#L19

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