OsmHeight

object OsmHeight

Resolves an OSM tag bag to a (minHeight, height) pair in meters.

Order of preference:

  1. Explicit height or building:height tag (with optional unit suffix m / ft).

  2. building:levels (× METERS_PER_LEVEL) plus optional roof:height.

  3. defaultHeight fallback (chosen by building=* value, see defaultHeightForBuilding).

min_height / building:min_height are honored when present (for upper-floor extrusions built on top of a podium, e.g. an antenna on a roof).

Properties

Link copied to clipboard
const val METERS_PER_FOOT: Double = 0.3048
Link copied to clipboard
const val METERS_PER_LEVEL: Double = 3.0

Functions

Link copied to clipboard

Heuristic default heights for common building=* values when no explicit height/levels are present. Picked to keep urban scenes legible without making every untagged shed a tower.

Link copied to clipboard
fun resolve(tags: Map<String, String>, defaultHeight: Double = defaultHeightForBuilding(tags)): Pair<Double, Double>