Repository navigation
Add GeometrySplitter - #1424
Add GeometrySplitter#1424
Conversation
|
Clearly we just need to move PostGIS and QGIS to the GEOS implementation ASAP and resolve the inconsistency problem 😄 |
|
Thank you!! I would LOVE to drop QGIS' fragile and inefficient version of this! 🥳🥳 |
|
This is very good news for everyone ! |
|
@dbaston I am testing this with Shapely, by using the new C API instead of the python homegrown splitting logic in shapely, and running the tests, and at the moment only noticing one issue / difference. For the case of splitting a line with a line, when both lines overlap (so not just cross), Shapely at the moment detects this and raises an error disallowing such input. With GEOS, the split function works: I don't have a strong opinion about what is the best behaviour (the above output seems the logical result if you want to have it just work), but just raising this to be sure this was a conscious design decision (or might warrant a test). |
|
Thanks @jorisvandenbossche , I should have listed this difference this in the PR description but forgot to. I don't know if either the GEOS or PostGIS behavior is a conscious design decision so much as a natural consequence of the implementation. PostGIS is taking advantage of a
There are in fact a couple: geos/tests/unit/operation/split/GeometrySplitterTest.cpp Lines 371 to 393 in 7ce7194 |
This PR adds a GeometrySplitter class for splitting linear or polygonal features using points, lines, and/or polygons.
Curved geometries are not yet supported. A couple of pieces are missing for this:
adding curve support to DistanceOp.
to split a CurvePolygon with a line/curve, we need to figure out which of the resulting polygons are insideEDIT: added RandomPointsBuilder from JTS to handle this.the original geometry. This is done with PIP tests, but the existing InteriorPointArea algorithm does not
support curves. Either InteriorPointArea could be extended for this, or we could compute interior points
by testing either (pseudo)random points or computing small offsets from segments/arcs.
I've added applicable test cases from PostGIS and QGIS, most of which are passing.
Currently not passing:
PostGIS does the same but I understand why the QGIS behavior is desirable.
the results from that software are desirable, though.