Reuse the prepared area index for the point-in-area test#7723
Open
vpaturet wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #7723 +/- ##
=============================================
- Coverage 74.09% 74.09% -0.01%
- Complexity 21929 21930 +1
=============================================
Files 2430 2430
Lines 86054 86057 +3
Branches 8573 8573
=============================================
+ Hits 63764 63765 +1
- Misses 19251 19252 +1
- Partials 3039 3040 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e066199 to
8256b44
Compare
The vertex-in-area check in snapAndLink used a raw Polygon.contains(point), which rebuilds a sweep-line index over the polygon boundary on every call, while addAreaVertex separately built a PreparedGeometry for the visibility fan-out. Build one PreparedAreaGroup per area and reuse it for the point test, the forced split-point edge and the fan-out, so the index is built once. Add PreparedAreaGroup.containsPoint and pass the prepared group into addAreaVertex instead of rebuilding it there. Behavior is unchanged (PreparedGeometry.contains matches Geometry.contains for points and segments).
8256b44 to
63c1e47
Compare
leonardehrenfried
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When linking a vertex into a walkable area,
VertexLinker.snapAndLinkdid the vertex-in-area check with a rawPolygon.contains(point), which rebuilds a sweep-line index over the polygon boundary on every call. Separately,addAreaVertexbuilt aPreparedGeometryfor the visibility-edge fan-out. So a single rental-in-area landing could build the area index up to three times.This change builds one
PreparedAreaGroupper area insnapAndLinkand reuses it for:PreparedAreaGroup.containsPoint),addAreaVertexvisibility fan-out (and, via Use PreparedGeometry instead of RelateNG for area containment #7722, the per-sub-area crossing checks).addAreaVertexnow takes the prepared group instead of rebuilding it.