Commit fe34635
feat: offer Nominatim entrance nodes as routing targets
A geocoded place drops its waypoint on the centroid, which for a large
site is nowhere a traveller can reach: BER's centroid sits on the
airfield, 1.5 km from the terminal doors, and the route ends on a slip
road. Nominatim reports a place's entrance nodes when asked
(`entrances=1`), so they are now offered as an alternative.
Clicking a door routes to it while the waypoint's pin stays on the place
that was searched for, joined by a dashed line. Every door stays on the
map, the chosen one marked, and clicking it again routes back to the
place.
The picker never chooses for the user. `entrance=main` records how a
building is laid out, not what a router can reach — the Pergamonmuseum
tags a main door the walking network stops 90 m short of, while its side
door is on the path — so acting on the tag would be confidently wrong
about as often as right.
Which doors are offered depends on two things:
- Direction, from the wiki's one-way values. `entrance=exit` is "a
one-way out" and so only usable at an origin; `entrance=entrance` is
"a one-way in" and only at a destination. A via point is both
arrived at and left from, so it takes neither.
- The travel mode, from the door's own OSM access tags, following the
access hierarchy (`motor_vehicle` > `vehicle` > `access`). Read live,
so switching profile re-applies the rules to what is on screen.
Doors are named from their OSM `name` tag where they have one, and
labelled permanently. Where labels collide the whole colliding run
collapses into one listing every door in it; zooming in separates them
again. Labels live in a pane below the marker pane, because Leaflet
derives a marker's z-index from its latitude and a zIndexOffset alone
cannot keep a dot above them.
Also here:
- The site outline is drawn beneath the doors, fetched only when the
picker opens. It is thinned with Visvalingam-Whyatt, stopping as soon
as the smallest surviving triangle would be visible, rather than with
Nominatim's polygon_threshold: that tolerance is absolute degrees, so
a value that usefully thins a 5 km airport flattens a 170 m building
into five stray corners.
- The gap between where a route can reach and its waypoint is now
dashed throughout. Leaflet Routing Machine's default draws it as a
solid casing with dashes on top, which against this app's heavy blue
route reads as more route.
- `continue_straight=true`, so OSRM leaves a via point by a different
way instead of doubling back. Measured at 1575 m against 1524 m on a
via at Hardenbergstrasse 36; a no-op without via points, and it still
routes where the u-turn is unavoidable.
- The persisted geocode cache moves to v2: entries predate the entrance
data, the OSM identifiers and the access tags.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 0e067ab commit fe34635
18 files changed
Lines changed: 3923 additions & 40 deletions
File tree
- css
- i18n
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
0 commit comments