SpatialHeightGrid

class SpatialHeightGrid(val columns: Int, val rows: Int, val heights: FloatArray, val covered: BooleanArray, val baseElevation: Float, val maxElevation: Float)(source)

Elevations sampled on a regular lon/lat grid over a box: the ground the terrain mesh is built on.

Constructors

Link copied to clipboard
constructor(columns: Int, rows: Int, heights: FloatArray, covered: BooleanArray, baseElevation: Float, maxElevation: Float)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Plan(val columns: Int, val rows: Int, val samplingZoom: Int)

How many vertices across and down, and which tile zoom to read them from.

Properties

Link copied to clipboard

Lowest covered height after cleaning (meters); 0 with no coverage.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Row-major, north to south, west to east. Meters above sea level.

Link copied to clipboard
Link copied to clipboard
val rows: Int

Functions

Link copied to clipboard
fun cleaned(featherCells: Int = 6): SpatialHeightGrid

Sea clamp, median-of-9 despike (the source data has isolated spikes on water), flat water, then uncovered cells sit at the lowest covered height with a short feathered slope into it.

Link copied to clipboard
fun height(u: Double, v: Double): Float

Cleaned, then bilinear height at a fraction across the grid (0..1 west to east, 0..1 north to south).

Link copied to clipboard

The same ground on a grid at least minimum vertices across and down, read bilinearly.