Add OSM elevation to point POIs#619
Open
candux wants to merge 1 commit into
Open
Conversation
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.
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.
Overview
I recently switched my personal project, https://wogibt.es/, from OpenMapTiles to Protomaps. Most attributes had a clear equivalent, but mountain peak elevation was missing: OSM
elevalues were not being exposed as theelevationattribute on Protomaps POIs.
I do not think this is intended behavior, since
natural=peakfeatures commonly rely onelefor displaying summit elevation.Example node: https://www.openstreetmap.org/node/1308250615/history/2
Before:
After:
Technical details
natural=peakfeatures are usually OSM point features. The POI layer already copied the OSMeletag toelevation, but only in the named-polygonpointOnSurfacepath. Point POIs therefore lost the attribute even when the sourcefeature had
ele.This change moves the
elevationassignment into the common POI attribute chain, so OSM POIs can carryelethrough to the output feature. Existing named-polygon behavior is preserved, and Planetiler still omits the attribute wheneleis absent.A regression test was added for
natural=peakwithele.Verification
Ran:
PoisTestmvn packagespotless:checkgit diff --checkFor the Saarland z15 scan:
elevationelevationThe remaining 64 peak features do not have OSM
elein the source data.AI assistance
This change was prepared with help from OpenAI Codex 5.5 xhigh.