SpatialFrame

data class SpatialFrame(val bounds: GeoBounds)(source)

The local frame a spatial map is built in: meters from the center of a geographic box, with x east, y up and z south (north is away from a viewer standing south of the model). The box is small enough that a flat-earth conversion around its center is accurate to well under a meter, which is finer than any mesh position.

Constructors

Link copied to clipboard
constructor(bounds: GeoBounds)

Types

Link copied to clipboard
object Companion

Properties

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

Depth (north-south) of the box in meters.

Link copied to clipboard

Meters per degree of longitude at the center latitude.

Link copied to clipboard

Width (east-west) of the box in meters.

Functions

Link copied to clipboard

The coordinate at a local x/z position.

Link copied to clipboard

Latitude at a Mercator fraction (0 = north edge, 1 = south edge) of the box.

Link copied to clipboard
fun localPosition(coordinate: LatLon, altitude: Double): Vec3

fun localPosition(latitude: Double, longitude: Double, altitude: Double): Vec3

Local position of a coordinate at a height in meters above sea level.

Link copied to clipboard
Link copied to clipboard
fun mercatorFraction(latitude: Double, longitude: Double): Pair<Double, Double>

Fraction (0...1) across the box, west to east and north to south, in Web Mercator. Used to line vertices up with a Mercator map image of the same box. Returns (u, v).