Skip to content

Add OSM elevation to point POIs#619

Open
candux wants to merge 1 commit into
protomaps:mainfrom
candux:fix-peak-elevation
Open

Add OSM elevation to point POIs#619
candux wants to merge 1 commit into
protomaps:mainfrom
candux:fix-peak-elevation

Conversation

@candux

@candux candux commented Jul 4, 2026

Copy link
Copy Markdown

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 ele values were not being exposed as the elevation
attribute on Protomaps POIs.

I do not think this is intended behavior, since natural=peak features commonly rely on ele for displaying summit elevation.

Example node: https://www.openstreetmap.org/node/1308250615/history/2

Before:

image

After:

image

Technical details

natural=peak features are usually OSM point features. The POI layer already copied the OSM ele tag to elevation, but only in the named-polygon pointOnSurface path. Point POIs therefore lost the attribute even when the source
feature had ele.

This change moves the elevation assignment into the common POI attribute chain, so OSM POIs can carry ele through to the output feature. Existing named-polygon behavior is preserved, and Planetiler still omits the attribute when
ele is absent.

A regression test was added for natural=peak with ele.

Verification

Ran:

  • PoisTest
  • full mvn package
  • spotless:check
  • git diff --check
  • before/after Saarland PMTiles scans

For the Saarland z15 scan:

  • Before: 0 / 489 peak features had elevation
  • After: 425 / 489 peak features had elevation

The remaining 64 peak features do not have OSM ele in the source data.

AI assistance

This change was prepared with help from OpenAI Codex 5.5 xhigh.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant