Support arcs in GeometryNoder / GEOSNode
This PR:
-
Reworks the
CircularArcclass to hold a reference to aCoordinateSequenceand position, rather than holding coordinates as values. This makes it easier for theCircularArcIntersetorto access the Z and M values of arc points, withoutCircularArchaving to store everything asCoordinateXYZM. TheCircularArcmay also own its ownCoordinateSequence, though this is mostly used for tests and should maybe be removed. -
Updates the
CircularArcIntersectorclass to perform Z/M interpolation, with behavior modeled on that ofLineIntersector. In particular, the Z/M values of intersection points are interopalted unless they match an arc endpoint, in which case they are taken from the endpoint with preference to the first arc. (This means that, likeLineIntersector, the intersection of A and B may be different from the intersection of B and A.) Z/M interpolation on intersection points is performed between arc end points (p0, p2) and the arc control point (p1). Control points are not preserved in the the output; output arcs will have a control point generated at the angle midway between arc endpoints. -
Adds a hierarchy of curve-capable noding classes. The idea here was to leave
SegmentString/Noder/IntersectionAdderunchanged, so the following classes are added:ArcString: equivalent of SegmentString, but for arcsPathString: a parent of SegmentString and ArcStringArcNoder: a derivative of Noder, who can also node not only a vector of SegmentStrings, but also a vector of PathStringsNodablePath: a PathString to which intersection points can be added (interface)NodableArcString: like it sounds. Captures the functionality of NodedSegmentString, SegmentNode, and SegmentNodeList.ArcIntersector: An interface likeSegmentIntersectorthat requires handling of the four possibleSegmentString/ArcStringcombinationsArcIntersectionAdder: Analog ofIntersectionAdderthat implementsArcIntersector.
-
"Upgrades" the brute-force
SimpleNoderfrom aNoderto anArcNoder. -
Makes
GeometryNoderfall back to aSimpleNoderif it receives curved inputs. Otherwise, it sticks with the defaultMCIndexNoder.
There are a few FIXME / TODO items remaining that I would address before merging.