Skip to content

Add optional height and min_height to the buildings layer #155

Description

@MichaelKreil

The buildings layer currently carries only dummy=1. I'd like to propose adding optional height and min_height fields so that Shortbread tiles can drive 3D extrusion.

We've implemented this in the VersaTiles Planetiler Shortbread profile and it works well in production:

Proposal

Add to the buildings layer (polygon, z14):

Field Name Type Description
height number height of the building in meters, optional
min_height number height of the bottom of the building in meters, optional

Both fields are optional: producers may omit them entirely (a strict 1.0-style implementation stays conformant), and consumers that don't render 3D simply ignore them. This is purely additive - geometry, zoom range and existing attributes are unchanged.

The naming matches the other general-purpose OSM schemas, so styles and tooling carry over: OpenMapTiles' building layer has render_height/render_min_height, and the Protomaps basemap has exactly height and min_height as numbers.

Derivation

Same rule as OpenMapTiles and Protomaps, which makes it familiar to most implementers:

  • height:

    1. height=* or building:height=*, parsed as meters (accepting the usual unit suffixes), else
    2. building:levels=* (or levels=*) × 3.66 m, else
    3. omitted - see below.
  • min_height:

    1. min_height=* or building:min_height=*, else
    2. building:min_level=* (or min_level=*) × 3.66 m.

    Emitted only when min_height > 0.

  • Implausible values (≥ 3660 m, i.e. 1000 levels - almost always tagging errors) are dropped.

No synthetic default. A building with no height information at all should simply have no height - absent means "unknown". A style that wants every building extruded can supply its own fallback with a single MapLibre coalesce. This keeps tiles smaller, since the majority of OSM buildings have no height tagging.

Open questions

  • Rounding / type. We round height up and min_height down to whole meters to keep tiles small; the spec could either mandate integers or leave the precision to the implementation.
  • Relation to buildings layer containing dummy=1 #77. This is the strongest argument for dropping dummy=1: the reason it exists is that the layer has no properties, and height gives the layer a genuinely useful one. The two are independent though - dummy can be dropped with or without this.
  • Follow-up, not part of this issue: OSM Simple 3D Buildings building:part polygons plus a way to mark the relation outline that must not be extruded (OpenMapTiles uses a hide_3d flag; Protomaps distinguishes kind=building from kind=building_part), and later possibly roof:shape / roof:height / colour. We have building:part implemented as a separate opt-in as well, but it's a bigger discussion and I'd rather see plain height land first.

Happy to write the spec text and example fixtures for 1.1 if there's agreement in principle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions