I don't see a good way to add a set of points to a polygon. For example, union does not add the new vertices:
geosop -a "POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))" -b "POINT (5 0)" union
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))
I extended the GeometrySplitter to handle this:
geosop -a "POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))" -b "POINT (5 0)" split
POLYGON ((0 0, 5 0, 10 0, 10 10, 0 10, 0 0))
but this is probably not the right place to do it, since the GeometrySplitter otherwise returns a GeometryCollection. A better place might be the GeometryNoder, but I don't want to mess with that while #1460 is pending.
The whole Noder API doesn't have a concept of points, so the implementation would probably add the explicit nodes to the Noder outputs.
A nice feature of the GeometrySplitter implementation is the snapping of vertices within some epsilon to the ring being split, e.g.
geosop -a "POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))" -b "POINT (10.00000000001 5)" split
POLYGON ((0 0, 10 0, 10 5, 10 10, 0 10, 0 0))
Maybe this behavior can be retained.
I don't see a good way to add a set of points to a polygon. For example,
uniondoes not add the new vertices:I extended the
GeometrySplitterto handle this:but this is probably not the right place to do it, since the
GeometrySplitterotherwise returns aGeometryCollection. A better place might be theGeometryNoder, but I don't want to mess with that while #1460 is pending.The whole
NoderAPI doesn't have a concept of points, so the implementation would probably add the explicit nodes to theNoderoutputs.A nice feature of the
GeometrySplitterimplementation is the snapping of vertices within some epsilon to the ring being split, e.g.Maybe this behavior can be retained.