Table of Contents

Class StaticElevationTileSet

Namespace
LansMap.Map.Elevation
public sealed class StaticElevationTileSet : IElevationTileSet, IDisposable
Inheritance
object
StaticElevationTileSet
Implements

Properties

HeightArray

Terrarium-encoded heights for the displaced tile shader, or null when nothing loaded.

public Texture2DArray HeightArray { get; }

Property Value

Texture2DArray

LayerCount

Layers actually present in HeightArray.

public int LayerCount { get; }

Property Value

int

LoadFailed

True once the fetch found zero usable Terrarium tiles - no network, every request failed, or the coverage list was empty. The map stays flat when this is true; a warning is logged exactly once, matching TerrariumElevationDrape's degrade-to-flat behavior.

public bool LoadFailed { get; }

Property Value

bool

MaxHeightMercator

The largest sampled height across every fetched tile, converted to normalized mercator at that tile's own center latitude. Feeds the displaced shader's skirt depth uniform and the NeedsReanchor(anchor, maxAltitudeMercator) overload for layers drawn over the elevated map. Zero when LoadFailed.

public double MaxHeightMercator { get; }

Property Value

double

Sampler

Ground height source for MapViewTransform's terrain constructor. FlatElevationSampler when the fetch found nothing, so the map degrades to flat rather than crashing or leaving a hole.

public IElevationSampler Sampler { get; }

Property Value

IElevationSampler

Methods

Build(IEnumerable<TileCoord>, ZoomLevel, string)

Fetches and uploads the tile set. Never throws on a fetch failure: the returned set degrades to flat (LoadFailed true, Sampler a FlatElevationSampler, no array), with exactly one warning logged here.

public static StaticElevationTileSet Build(IEnumerable<TileCoord> coverageTiles, ZoomLevel zoom, string cacheDir)

Parameters

coverageTiles IEnumerable<TileCoord>

The bounded set of Terrarium tiles to fetch, all at zoom.

zoom ZoomLevel

Terrarium zoom level every tile in coverageTiles is at.

cacheDir string

Disk cache directory for downloaded tiles, or null to disable caching, passed straight through to TerrariumTileFetch.

Returns

StaticElevationTileSet

BuildFromDecoded(IReadOnlyDictionary<long, TerrariumHeightTile>, ZoomLevel)

Same construction as Build(IEnumerable<TileCoord>, ZoomLevel, string), from an already-decoded tile set rather than a live fetch. The seam a caller with its own decoded tiles - or a test that must not touch the network - uses to exercise the array upload, coverage lookup and degrade-to-flat behavior directly.

public static StaticElevationTileSet BuildFromDecoded(IReadOnlyDictionary<long, TerrariumHeightTile> decoded, ZoomLevel zoom)

Parameters

decoded IReadOnlyDictionary<long, TerrariumHeightTile>
zoom ZoomLevel

Returns

StaticElevationTileSet

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

EncodeMeters(double, out byte, out byte, out byte)

public static void EncodeMeters(double meters, out byte r, out byte g, out byte b)

Parameters

meters double
r byte
g byte
b byte

TryGetCoverage(TileCoord, out ElevationCoverage)

GPU coverage for one base tile: which array layer and UV subrect hold its heightmap.

public bool TryGetCoverage(TileCoord baseTile, out ElevationCoverage coverage)

Parameters

baseTile TileCoord
coverage ElevationCoverage

Returns

bool

Remarks

None when the tile's exact elevation-zoom ancestor was not in the fetched set (as well as when nothing was fetched at all, LoadFailed, or the base tile is shallower than the elevation zoom - a known slice 1 gap, not handled by spanning multiple layers), matching HeightmapElevationSampler's flat-outside-coverage contract on the CPU side.