Commit e066199
committed
perf(street): reuse the prepared area index for the point-in-area test
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).1 parent 9516d05 commit e066199
3 files changed
Lines changed: 40 additions & 8 deletions
File tree
- street/src
- main/java/org/opentripplanner/street/linking
- test/java/org/opentripplanner/street/linking
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
60 | | - | |
| 74 | + | |
61 | 75 | | |
62 | 76 | | |
63 | 77 | | |
| |||
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
448 | | - | |
| 451 | + | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
| |||
464 | 467 | | |
465 | 468 | | |
466 | 469 | | |
467 | | - | |
| 470 | + | |
468 | 471 | | |
469 | 472 | | |
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
473 | 476 | | |
474 | | - | |
| 477 | + | |
475 | 478 | | |
476 | 479 | | |
477 | 480 | | |
| |||
652 | 655 | | |
653 | 656 | | |
654 | 657 | | |
655 | | - | |
| 658 | + | |
656 | 659 | | |
657 | 660 | | |
658 | 661 | | |
| |||
672 | 675 | | |
673 | 676 | | |
674 | 677 | | |
675 | | - | |
| 678 | + | |
676 | 679 | | |
677 | 680 | | |
678 | 681 | | |
679 | 682 | | |
| 683 | + | |
680 | 684 | | |
681 | | - | |
682 | | - | |
683 | 685 | | |
684 | 686 | | |
685 | 687 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
| |||
0 commit comments