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

Flatten simple geometry collections #42

Merged

Conversation

mojodna
Copy link
Contributor

@mojodna mojodna commented Nov 13, 2024

Description of changes:

GeoJSONLint complains about these types of features:

GeometryCollection with a single geometry should be avoided in favor of single part or a single object of multi-part type

This PR simplifies features containing GeometryCollections with single geometries by removing the intermediate GeometryCollection.

This simultaneously expands (GeometryCollection | Polygon) and narrows (GeometryCollection<Polygon | LineString>) the type of GeoJSON features created from isolines. We should consider the versioning implications of this.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mojodna mojodna requested a review from a team as a code owner November 13, 2024 18:15
Copy link
Contributor

@mbalfour-amzn mbalfour-amzn left a comment

Choose a reason for hiding this comment

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

The README should also get updated to describe the API change. Also, if the intent is to release a new version with this change, the version number should get bumped too. I would suggest "1.2.0" since I don't think it's exactly a breaking change if people are just using it as GeoJSON output, but it's more than a bugfix.

src/to-geojson/georoutes-converter.ts Outdated Show resolved Hide resolved
@mojodna
Copy link
Contributor Author

mojodna commented Nov 13, 2024

I'll push a change with an update to the README. +1 to 1.2.0 (I agree with your reasoning).

@mojodna mojodna changed the title Flatten-simple-geometry-collections Flatten simple geometry collections Nov 13, 2024
@mojodna mojodna force-pushed the flatten-simple-geometry-collections branch 2 times, most recently from b76a212 to d3aaa74 Compare November 13, 2024 20:51
CHANGELOG.md Outdated Show resolved Hide resolved
tjmichaels
tjmichaels previously approved these changes Nov 14, 2024
@mojodna mojodna force-pushed the flatten-simple-geometry-collections branch from d3aaa74 to db5c817 Compare November 14, 2024 22:53
GeoJSONLint complains about these types of features:

> GeometryCollection with a single geometry should be avoided in favor
> of single part or a single object of multi-part type

This simultaneously expands (`GeometryCollection | Polygon`) and narrows
(`GeometryCollection<Polygon | LineString>`) the type of GeoJSON
features created from isolines.
@cgalvan cgalvan force-pushed the flatten-simple-geometry-collections branch from db5c817 to a855bb0 Compare November 14, 2024 22:58
@cgalvan cgalvan merged commit a9fc010 into aws-geospatial:main Nov 14, 2024
1 check 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.

4 participants