Skip to content

geo.map.terrain

6 functions / 9 types

Index

FunctionDescription
displayCastRayFind the first point of a map’s drawn ground that a ray in world space meets.
displayCastSegmentIntersect the displayed ground between two positions. Both endpoints count unless endpointExclusion excludes a distance in meters from each end.
displayPickFind the ground of any map under a point of a viewport, the nearest where several maps lie under it.
getDisplayHeightRead the displayed ground height in meters in the map’s common elevation reference. Provenance retains the source reference, units, and conversion or assumption applied.
getDisplayHeightsRead the heights of the drawn ground at many places, such as along an elevation profile, in the order given, each as geo.map.terrain.get_display_height reads it. Their heights are ignored.
getFullResolutionHeightFetch the finest advertised elevation at a position without changing camera tile selection. Returns unexaggerated meters and source provenance. Missing leaf data never uses a parent tile.
TypeDescription
ElevationConversion
FullResolutionHeight
FullResolutionProvenance
FullResolutionSample
HeightProvenanceThe source interpretation before conversion to the map’s common height reference.
HeightSampleThe displayed terrain height at one place, using the resident level of detail.
HorizontalSampleSpacing
MapHitWhere a ray met the ground.
NoData

displayCastRay

displayCastRay(args: { direction: MathVec3; map: SceneNode; maxDistance?: number; origin: MathVec3 }, transactionId?: string): Promise<GeoMapTerrainMapHit | undefined>

Find the first point of a map’s drawn ground that a ray in world space meets.

Returns nothing before the map’s first presentation or when the ray meets no ground within maxDistance. Fails with WrongNodeKind when map is not a map, and with InvalidArgument when direction is zero or not finite or origin is not finite.

Returns Promise<GeoMapTerrainMapHit | undefined>.

direction : MathVec3

Which way it goes. Any length but zero.

map : SceneNode

The node geo.map.spawn_map answered for the map whose ground the ray meets.

maxDistance optional : number

The farthest a hit counts, in meters. Absent, any distance.

origin : MathVec3

Where the ray starts.

transactionId optional : string

displayCastSegment

displayCastSegment(args: { endpointExclusion?: number; from: GeoGeoPosition; map: SceneNode; to: GeoGeoPosition }, transactionId?: string): Promise<GeoMapTerrainMapHit | undefined>

Intersect the displayed ground between two positions. Both endpoints count unless endpointExclusion excludes a distance in meters from each end.

Positions use their explicit elevation references. Returns nothing when the segment misses the presented mesh or either position cannot be placed. Fails with WrongNodeKind when map is not a map, and with InvalidArgument when either end is not a place.

Returns Promise<GeoMapTerrainMapHit | undefined>.

endpointExclusion optional : number

Ignore this many meters at each endpoint. Absent, endpoints count.

map : SceneNode

The node geo.map.spawn_map answered for the map both places are on.

transactionId optional : string

displayPick

displayPick(args: { viewport?: string; x: number; y: number }, transactionId?: string): Promise<GeoMapTerrainMapHit | undefined>

Find the ground of any map under a point of a viewport, the nearest where several maps lie under it.

Returns nothing over sky or before the map’s first presentation. Fails with InvalidArgument unless exactly one viewport matches viewport.

Returns Promise<GeoMapTerrainMapHit | undefined>.

viewport optional : string

Label of the viewport to pick in. Absent, the only viewport.

x : number

Logical pixels from the viewport’s left edge.

y : number

Logical pixels from the viewport’s top edge.

transactionId optional : string

getDisplayHeight

getDisplayHeight(args: { map: SceneNode; outputReference?: GeoElevationReference; position: GeoGeoPosition }, transactionId?: string): Promise<GeoMapTerrainHeightSample>

Read the displayed ground height in meters in the map’s common elevation reference. Provenance retains the source reference, units, and conversion or assumption applied.

The result includes terrain height scale and follows the triangles currently drawn, including LOD blending and morph. The height is absent where no presented triangle is hit. Fails with WrongNodeKind when map is not a map, and with InvalidArgument when the latitude is outside -90 to 90 or a coordinate is not finite.

Returns: The displayed terrain height at one place, using the resident level of detail.

Returns Promise<GeoMapTerrainHeightSample>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

outputReference optional : GeoElevationReference

Absent, use the map’s elevation reference. Conversion preserves display height scale.

position : GeoGeoPosition

transactionId optional : string

getDisplayHeights

getDisplayHeights(args: { map: SceneNode; outputReference?: GeoElevationReference; points?: Array<GeoGeoPosition> }, transactionId?: string): Promise<Array<GeoMapTerrainHeightSample>>

Read the heights of the drawn ground at many places, such as along an elevation profile, in the order given, each as geo.map.terrain.get_display_height reads it. Their heights are ignored.

Fails with WrongNodeKind when map is not a map, and with InvalidArgument when any point is not a place.

Returns Promise<Array<GeoMapTerrainHeightSample>>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

outputReference optional : GeoElevationReference

points optional : Array<GeoGeoPosition>

The places to sample.

transactionId optional : string

getFullResolutionHeight

getFullResolutionHeight(args: { map: SceneNode; outputReference?: GeoElevationReference; position: GeoGeoPosition }, transactionId?: string): Promise<GeoMapTerrainFullResolutionHeight>

Fetch the finest advertised elevation at a position without changing camera tile selection. Returns unexaggerated meters and source provenance. Missing leaf data never uses a parent tile.

Returns Promise<GeoMapTerrainFullResolutionHeight>.

map : SceneNode

outputReference optional : GeoElevationReference

Absent, return the map’s elevation reference. This never applies display height scale.

position : GeoGeoPosition

transactionId optional : string

ElevationConversion

Enum

Geoid = 1

Unchanged = 0

FullResolutionHeight

type GeoMapTerrainFullResolutionHeight = { kind: "sample"; value: GeoMapTerrainFullResolutionSample } | { kind: "noData"; value: GeoMapTerrainNoData }

FullResolutionProvenance

accuracyMeters optional : number

Absent when the source publishes no numeric accuracy estimate.

decodedSourceValue optional : number

geoidCorrectionMeters : number

providerIdentifier : string

sampleSpacing optional : GeoMapTerrainHorizontalSampleSpacing

selectedTime optional : string

sourceGeoidModel optional : GeoGeoidModelId

sourceHeightMeters : number

sourceReference : GeoElevationReference

sourceUnitScale : number

sourceVerticalOffset : number

targetGeoidModel optional : GeoGeoidModelId

tileColumn : number

tileMatrixId : GeoTileMatrixId

tileRow : number

FullResolutionSample

heightMeters : number

HeightProvenance

The source interpretation before conversion to the map’s common height reference.

conversion optional : GeoMapTerrainElevationConversion

identifier : string

layerId optional : GeoMapLayerLayerId

The layer handle, when the source still belongs to the map.

reference optional : GeoElevationReference

unitScale optional : number

Meters per original source unit.

verticalOffset optional : number

Meters added after scaling the original source value.

HeightSample

The displayed terrain height at one place, using the resident level of detail.

height optional : number

Meters in the returned reference, including terrain height scale. Absent where no presented terrain triangle is hit.

level optional : number

The drawn tile level, absent where no drawn tile covers the point.

provenance optional : GeoMapTerrainHeightProvenance

The resident elevation source at this location. Absent when no source sample is resident. This does not enumerate the vertex or LOD-blend contributors to the displayed triangle.

reference optional : GeoElevationReference

terrainHeightScale : number

HorizontalSampleSpacing

eastMeters : number

northMeters : number

MapHit

Where a ray met the ground.

distance : number

Meters from where the ray started.

level : number

The level of the tile the ray met, 0 being the coarsest.

map : SceneNode

The map hit.

point : GeoGeoPosition

The hit as a place on the body.

position : MathVec3

The hit in world space.

NoData

layersConsidered optional : Array<GeoMapLayerLayerId>