Support arcs in GeometryNoder / GEOSNode #1347
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.