convert geojson #4
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.