Commit 9516d05
committed
perf(street): use PreparedGeometry instead of RelateNG for area containment
The containsSegment check in PreparedAreaGroup used RelateNG to prepare and
reuse a spatial index over the area-group polygon. Benchmarks (see PR #7715
discussion) show the classic PreparedGeometry API is faster than RelateNG for
this contains predicate, and the sibling areasCrossedBy crossing test already
uses PreparedGeometry. Switch containsSegment to PreparedGeometry.contains for
consistency and performance.
This restores the pre-#7696 semantics of plain Polygon.contains (which can
throw TopologyException on invalid polygons) but keeps the prepared-index reuse
that #7696 introduced.1 parent 2e891ca commit 9516d05
1 file changed
Lines changed: 6 additions & 8 deletions
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| |||
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
| 37 | + | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
55 | | - | |
56 | | - | |
| 53 | + | |
| 54 | + | |
57 | 55 | | |
58 | 56 | | |
59 | | - | |
60 | | - | |
| 57 | + | |
| 58 | + | |
61 | 59 | | |
62 | | - | |
| 60 | + | |
63 | 61 | | |
64 | 62 | | |
65 | 63 | | |
| |||
0 commit comments