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

Add Homogenize #385

Open
peterstace opened this issue Jul 18, 2021 · 0 comments
Open

Add Homogenize #385

peterstace opened this issue Jul 18, 2021 · 0 comments
Labels
algorithm These are the fun tickets :-) feature New feature or request

Comments

@peterstace
Copy link
Owner

It would be similar to https://postgis.net/docs/ST_CollectionHomogenize.html

ST_CollectionHomogogenize has a bad characteristic that it can return invalid MultiPolygons. That's not a good idea... Instead, we would return Polygons separately.

It should be a new method Homogenize() Geometry on GeometryCollections. It should:

  • Empty geometries inside the geometry collection should be ignored.
  • If after ignoring empty geometries there is nothing left, then it should return an empty GC.
  • If the GC contains a single geometry, it should return it as a single geometry.
  • All points (whether from singular points or multipoints) will be merged into a single multipoint.
  • All linestrings (whether from singular linestrings or multilinestrings) will be merged into a single multilinestring.
  • Polygons and Multipolygons will NOT be merged, to avoid invalid MultiPolygons.
  • If there is just a single multi geometry (i.e. multipoint, multilinetring) or areal geometry (polygon or multipolygon) then they can be returned on their own.
  • But if there are multiple, they get returned in a new GC (multipolygons first, then polygons, then multilinestrings/linestring, then multipoint/point).
@peterstace peterstace added feature New feature or request algorithm These are the fun tickets :-) labels Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
algorithm These are the fun tickets :-) feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant