Commit fdea644
authored
Add OSM elevation to point POIs (#619)
* Add OSM elevation to point POIs
Natural peak features are usually OSM point features, but the POI layer only copied the OSM ele tag while building the named-polygon point-on-surface output. That meant point peaks were emitted without the elevation attribute even when the source feature had ele set.
Move the elevation assignment into the common POI attribute chain so all OSM POIs can carry ele through to the output feature. This preserves the existing named-polygon behavior and lets Planetiler omit the attribute naturally when ele is absent.
Add a regression test covering natural=peak with ele to make sure peak POIs expose elevation.
Verification: ran PoisTest, full mvn package, spotless:check, git diff --check, and before/after Saarland PMTiles scans. The Saarland z15 scan changed from 0/489 peak features with elevation before the fix to 425/489 after the fix; the remaining peaks lack OSM ele in the source.
AI assistance: this change was prepared with help from OpenAI Codex.
* Parse POI elevation as numeric
OSM ele represents elevation in metres, so expose POI elevation as a numeric tile value instead of passing through raw tag text. This applies both to polygon-derived POIs that already carried elevation and to point POIs added by the previous change.
Add a conservative parser that accepts clean signed decimal values, including an optional trailing m suffix with or without whitespace, and emits rounded integer metres. Omit elevation when ele contains other units or free text. Update POI tests to assert integer elevation for peak and named polygon output and cover decimal, metre-suffixed, and invalid values.
AI assistance: This change was prepared with help from OpenAI Codex.1 parent a9fa48f commit fdea644
2 files changed
Lines changed: 84 additions & 5 deletions
File tree
- tiles/src
- main/java/com/protomaps/basemap/layers
- test/java/com/protomaps/basemap/layers
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| |||
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
49 | 73 | | |
50 | 74 | | |
51 | 75 | | |
| |||
501 | 525 | | |
502 | 526 | | |
503 | 527 | | |
504 | | - | |
505 | | - | |
506 | | - | |
| 528 | + | |
507 | 529 | | |
508 | 530 | | |
509 | 531 | | |
| |||
525 | 547 | | |
526 | 548 | | |
527 | 549 | | |
528 | | - | |
| 550 | + | |
| 551 | + | |
529 | 552 | | |
530 | 553 | | |
531 | 554 | | |
| |||
Lines changed: 57 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
200 | 256 | | |
201 | 257 | | |
202 | 258 | | |
| |||
629 | 685 | | |
630 | 686 | | |
631 | 687 | | |
632 | | - | |
| 688 | + | |
633 | 689 | | |
634 | 690 | | |
635 | 691 | | |
| |||
0 commit comments