geo.map.terrain
6 functions / 9 types
Index
| Function | Description |
|---|---|
| display_cast_ray | Find the first point of a map’s drawn ground that a ray in world space meets. |
| display_cast_segment | Intersect the displayed ground between two positions. Both endpoints count unless endpoint_exclusion excludes a distance in meters from each end. |
| display_pick | Find the ground of any map under a point of a viewport, the nearest where several maps lie under it. |
| get_display_height | 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. |
| get_display_heights | 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. |
| get_full_resolution_height | 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. |
| Type | Description |
|---|---|
| ElevationConversion | The ElevationConversion proto enum. |
| FullResolutionHeight | FullResolutionHeight |
| FullResolutionProvenance | FullResolutionProvenance |
| FullResolutionSample | FullResolutionSample |
| HeightProvenance | The source interpretation before conversion to the map’s common height reference. |
| HeightSample | The displayed terrain height at one place, using the resident level of detail. |
| HorizontalSampleSpacing | HorizontalSampleSpacing |
| MapHit | Where a ray met the ground. |
| NoData | NoData |
display_cast_ray
def display_cast_ray(
*,
map: types.scene.Node,
origin: types.math.Vec3,
direction: types.math.Vec3,
max_distance: float | None = None,
_transaction_id: str | None = None
) -> types.geo.map.terrain.MapHit | NoneFind 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
max_distance. 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 MapHit | None.
map : Node
The node geo.map.spawn_map answered for the map whose ground the ray meets.
origin : Vec3
Where the ray starts.
direction : Vec3
Which way it goes. Any length but zero.
max_distance optional : float | None
The farthest a hit counts, in meters. Absent, any distance. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
display_cast_segment
def display_cast_segment(
*,
map: types.scene.Node,
from_: types.geo.GeoPosition,
to: types.geo.GeoPosition,
endpoint_exclusion: float | None = None,
_transaction_id: str | None = None
) -> types.geo.map.terrain.MapHit | NoneIntersect the displayed ground between two positions. Both endpoints count unless
endpoint_exclusion 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 MapHit | None.
map : Node
The node geo.map.spawn_map answered for the map both places are on.
from_ : GeoPosition
to : GeoPosition
endpoint_exclusion optional : float | None
Ignore this many meters at each endpoint. Absent, endpoints count. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
display_pick
def display_pick(
*,
viewport: str | None = None,
x: float,
y: float,
_transaction_id: str | None = None
) -> types.geo.map.terrain.MapHit | NoneFind 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 MapHit | None.
viewport optional : str | None
Label of the viewport to pick in. Absent, the only viewport. Defaults to None.
x : float
Logical pixels from the viewport’s left edge.
y : float
Logical pixels from the viewport’s top edge.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_display_height
def get_display_height(
*,
map: types.scene.Node,
position: types.geo.GeoPosition,
output_reference: types.geo.ElevationReference | None = None,
_transaction_id: str | None = None
) -> types.geo.map.terrain.HeightSampleRead 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 HeightSample.
map : Node
The node geo.map.spawn_map answered for the map.
position : GeoPosition
output_reference optional : ElevationReference | None
Absent, use the map’s elevation reference. Conversion preserves display height scale. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_display_heights
def get_display_heights(
*,
map: types.scene.Node,
points: list[types.geo.GeoPosition] | None = None,
output_reference: types.geo.ElevationReference | None = None,
_transaction_id: str | None = None
) -> tuple[types.geo.map.terrain.HeightSample, ...]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 tuple[HeightSample, ...].
map : Node
The node geo.map.spawn_map answered for the map.
points optional : list[GeoPosition] | None
The places to sample. Defaults to None.
output_reference optional : ElevationReference | None
Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_full_resolution_height
def get_full_resolution_height(
*,
map: types.scene.Node,
position: types.geo.GeoPosition,
output_reference: types.geo.ElevationReference | None = None,
_transaction_id: str | None = None
) -> types.geo.map.terrain.FullResolutionHeightFetch 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 FullResolutionHeight.
map : Node
position : GeoPosition
output_reference optional : ElevationReference | None
Absent, return the map’s elevation reference. This never applies display height scale. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
ElevationConversion
Enum
class ElevationConversion(IntEnum)The ElevationConversion proto enum.
Values: UNCHANGED = 0 GEOID = 1
UNCHANGED = 0
GEOID = 1
FullResolutionHeight
FullResolutionHeight()FullResolutionHeight
Construct one of the nested classes. Use isinstance to check its type.
FullResolutionHeight.Sample
FullResolutionHeight.Sample(value: types.geo.map.terrain.FullResolutionSample)FullResolutionHeight.Sample
value : FullResolutionSample
FullResolutionHeight.NoData
FullResolutionHeight.NoData(value: types.geo.map.terrain.NoData)FullResolutionHeight.NoData
value : NoData
FullResolutionProvenance
FullResolutionProvenance(
*,
layer_id: types.geo.map.layer.LayerId,
provider_identifier: str,
source_reference: types.geo.ElevationReference,
source_height_meters: float,
source_unit_scale: float,
source_vertical_offset: float,
decoded_source_value: float | None = None,
source_geoid_model: types.geo.GeoidModelId | None = None,
target_geoid_model: types.geo.GeoidModelId | None = None,
geoid_correction_meters: float,
conversion: types.geo.map.terrain.ElevationConversion,
selected_time: str | None = None,
tile_matrix_id: types.geo.TileMatrixId,
tile_column: int,
tile_row: int,
sample_spacing: types.geo.map.terrain.HorizontalSampleSpacing | None = None,
accuracy_meters: float | None = None
)FullResolutionProvenance
layer_id : LayerId
provider_identifier : str
source_reference : ElevationReference
source_height_meters : float
source_unit_scale : float
source_vertical_offset : float
decoded_source_value optional : float | None
Defaults to None.
source_geoid_model optional : GeoidModelId | None
Defaults to None.
target_geoid_model optional : GeoidModelId | None
Defaults to None.
geoid_correction_meters : float
conversion : ElevationConversion
selected_time optional : str | None
Defaults to None.
tile_matrix_id : TileMatrixId
tile_column : int
tile_row : int
sample_spacing optional : HorizontalSampleSpacing | None
Defaults to None.
accuracy_meters optional : float | None
Absent when the source publishes no numeric accuracy estimate. Defaults to None.
FullResolutionSample
FullResolutionSample(
*,
height_meters: float,
reference: types.geo.ElevationReference,
provenance: types.geo.map.terrain.FullResolutionProvenance
)FullResolutionSample
HeightProvenance
HeightProvenance(
*,
layer_id: types.geo.map.layer.LayerId | None = None,
identifier: str,
reference: types.geo.ElevationReference | None = None,
unit_scale: float | None = None,
vertical_offset: float | None = None,
conversion: types.geo.map.terrain.ElevationConversion | None = None
)The source interpretation before conversion to the map’s common height reference.
layer_id optional : LayerId | None
The layer handle, when the source still belongs to the map. Defaults to None.
identifier : str
reference optional : ElevationReference | None
Defaults to None.
unit_scale optional : float | None
Meters per original source unit. Defaults to None.
vertical_offset optional : float | None
Meters added after scaling the original source value. Defaults to None.
conversion optional : ElevationConversion | None
Defaults to None.
HeightSample
HeightSample(
*,
height: float | None = None,
terrain_height_scale: float,
level: int | None = None,
reference: types.geo.ElevationReference | None = None,
provenance: types.geo.map.terrain.HeightProvenance | None = None
)The displayed terrain height at one place, using the resident level of detail.
height optional : float | None
Meters in the returned reference, including terrain height scale. Absent where no presented terrain triangle is hit. Defaults to None.
terrain_height_scale : float
level optional : int | None
The drawn tile level, absent where no drawn tile covers the point. Defaults to None.
reference optional : ElevationReference | None
Defaults to None.
provenance optional : HeightProvenance | None
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. Defaults to None.
HorizontalSampleSpacing
HorizontalSampleSpacing(*, east_meters: float, north_meters: float)HorizontalSampleSpacing
east_meters : float
north_meters : float
MapHit
MapHit(
*,
map: types.scene.Node,
position: types.math.Vec3,
point: types.geo.GeoPosition,
distance: float,
level: int
)Where a ray met the ground.
map : Node
The map hit.
position : Vec3
The hit in world space.
point : GeoPosition
The hit as a place on the body.
distance : float
Meters from where the ray started.
level : int
The level of the tile the ray met, 0 being the coarsest.
NoData
NoData(*, layers_considered: tuple[types.geo.map.layer.LayerId, ...] = ())NoData
layers_considered optional : tuple[LayerId, ...]
Defaults to ().