OsmBuildingsTile

class OsmBuildingsTile(buildings: List<OsmBuilding>, var attributes: ShapeAttributes, useOsmColors: Boolean = false, var shadowMode: ShadowMode = ShadowMode.ENABLED, displayName: String? = null) : AbstractRenderable

Renders every building of one slippy-map tile as a single batched mesh — one VBO + one EBO per tile per Globe.State, regardless of building count. Drop-in replacement for the legacy "one earth.worldwind.shape.Polygon per building" path that OOMs the Adreno KGSL shared-memory pool on dense urban tiles (~500 buildings × 4 buffers × ≥1-page mmap exhausts the kernel's GPU buffer-object slots by count long before raw bytes become a concern). Per-tile batching is the approach Cesium 3D Tiles b3dm, Mapbox fill-extrusion, and deck.gl SolidPolygonLayer all use for the same reason.

Per-building wall / roof colour (useOsmColors) is supported by grouping triangles within the tile's element array by colour and issuing one DrawShapeState.drawElements call per colour. Same one-VBO-one-EBO footprint; just more sub-draw calls per tile. A uniform-colour tile (the default) collapses to a single sub-draw.

Geometry per building follows the OSM "Simple 3D Buildings" convention:

  • Top cap: flat horizontal slab tessellated via GLU (with holes from inner rings) at max(corner ground) + height so the roof clears every footprint corner.

  • Side walls: each edge gets four fresh corner vertices (no sharing across walls or with the cap) so the fragment shader's dFdx-derived flat normal stays sharp at every face break. Ground-rooted walls drape their base to per-corner local terrain — the wall meets the ground at each corner regardless of slope.

  • Bottom cap: only when OsmBuilding.minHeight> 0 (floating slab — bridges, podiums). For floating buildings the wall base is also planar at max(corner ground) + minHeight so the slab stays coplanar with the floor cap.

Per-building picking: in pick mode each OsmBuilding gets its own pick id and one DrawShapeState.drawElements sub-draw. A separate building-major element buffer (TileData.pickElementArray) backs this; the visual EBO stays colour-major. Click hits resolve to the OsmBuilding via PickedObject.userObject.

Constructors

Link copied to clipboard
constructor(buildings: List<OsmBuilding>, attributes: ShapeAttributes, useOsmColors: Boolean = false, shadowMode: ShadowMode = ShadowMode.ENABLED, displayName: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override var displayName: String?
Link copied to clipboard
open override var isEnabled: Boolean
Link copied to clipboard
open override var isPickEnabled: Boolean
Link copied to clipboard
open override var pickDelegate: Any?
Link copied to clipboard

Per-tile shadow participation; overrides attributes's shadow mode so a layer can set shadow behaviour for all its tiles without mutating user-supplied ShapeAttributes.

Link copied to clipboard
open override var zOrder: Double

Functions

Link copied to clipboard
open override fun <T> getUserProperty(key: Any): T?
Link copied to clipboard
open override fun hasUserProperty(key: Any): Boolean
Link copied to clipboard
open override fun putUserProperty(key: Any, value: Any): Any?
Link copied to clipboard

Drops this tile's GL buffer entries from earth.worldwind.render.RenderResourceCache for every cached globe state. Called by OsmBuildingsLayer on LRU eviction so the kernel reclaims GPU pages eagerly instead of waiting for renderResourceCache pressure.

Link copied to clipboard
open override fun removeUserProperty(key: Any): Any?
Link copied to clipboard
open override fun render(rc: RenderContext)