Skip to content

Conversation

@mishaschwartz
Copy link
Collaborator

If a user uploads a GeoJSON that is not compatible with the STAC spec, we can try to convert it into a format that is compatible.

STAC supports all GeoJSON geometries except for geometry-collections. However, a user could upload a feature, geometry-collection, or feature collection. Previously, these were considered invalid geometries but in some cases they can be converted to a STAC-compliant geometry.

For example, a feature-collection containing a point and a multipoint or multiple points can be converted to a single multipoint containing the same point data; a geometry-collection containing 3 polygons can be converted to a multi-polygon.

This is especially useful if a user uploads a GeoJSON generated by a website like geojson.io which always generates feature-collections.

When a user uploads a GeoJSON, it is validated to ensure that it can be converted to a STAC-compliant format. When the STAC representation of a data request is created, the uploaded geometry is then converted and added to the generated STAC item.

description: str | None = None
authors: list[Author]
geometry: Geometry | None
geometry: GeoJSON | None

Choose a reason for hiding this comment

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

Does this mean the frontend will now have to submit a geojson instead of just the geometry portion?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, nothing has to change on the frontend

@mishaschwartz mishaschwartz merged commit 591f10c into main Nov 5, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants