MapterhornElevation

class MapterhornElevation(bounds: GeoBounds? = null, store: TerrainTileStore? = null, zoom: Int = DEFAULT_ZOOM, http: HttpClient? = null, offline: List<RegionTerrain> = emptyList()) : ElevationSource, AutoCloseable(source)

Real elevation from the same Mapterhorn terrain the map already uses for hillshade and contours.

Common, not desktop-only: tile bytes arrive over ktor and decodeTerrariumTile is already expect/actual with android and jvm actuals. The native actual of the decoder throws by design (see its doc comment in feature:map-terrain), which is the same trade that module already makes.

This is what makes a coverage plot mean anything: over flat synthetic ground it is a bullseye and proves nothing. Against real terrain the prediction has to show ridges shadowing valleys, which is the entire reason the planner exists.

Decoded tiles are shared process-wide and, given a store, kept on disk between launches.

Constructors

Link copied to clipboard
constructor(bounds: GeoBounds? = null, store: TerrainTileStore? = null, zoom: Int = DEFAULT_ZOOM, http: HttpClient? = null, offline: List<RegionTerrain> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

How many tiles are decoded and resident, useful when reporting a run.

Link copied to clipboard

The zoom actually in use, for reporting.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun elevationMeters(latitude: Double, longitude: Double): Double
Link copied to clipboard
suspend fun forgetStandIns()

Drop every stand-in tile from the shared cache. Call after close, once no decode can still complete and add one.

Link copied to clipboard
suspend fun prefetch(site: Site): Int

Warm every tile a sweep of site will touch.

suspend fun prefetch(area: GeoBounds? = bounds): Int

Warm every tile inside area before anything asks for one, many at a time.