geo.map
15 functions / 6 types
Modules
Index
| Function | Description |
|---|---|
| get_ground_color | Read the color a map’s ground is drawn in where no imagery layer covers it. Fails with WrongNodeKind when map is not a map. |
| get_level_blend | Read the part of the level blend band a map’s imagery blends across, as geo.map.set_level_blend set it. |
| get_map | Read a map: how it is shown, its layers and how its streaming is going. Fails with WrongNodeKind when map is not a map. |
| get_maps | Read every map in the scene, in the order they were spawned, each as geo.map.get_map reads it. |
| get_terrain_geomorph | Read whether a map draws its terrain heights morphed by camera position, as geo.map.set_terrain_geomorph set it. |
| get_terrain_quality | Read the terrain detail every map draws at. |
| set_air | Set the air around the body a map is drawn on, or none. Without air the ground takes the light above the air. Nothing is fetched again. |
| set_auto_exposure | Give one map a curve of its own, over its viewports’ curves, for an app that wants each body to look its own way. Absent curve clears it, and the map takes its viewports’ curves again. |
| set_ground_color | Set the color a map’s ground is drawn in where no imagery layer covers it, and answer the color now drawn there. |
| set_level_blend | Set how sharply a map’s imagery changes from one level of detail to the next. |
| set_surface | Set the figure and relief of the body a map is drawn on. The map is drawn again on the new figure from the next frame, and the tiles it holds are kept. |
| set_terrain_geomorph | Set whether a map draws its terrain heights morphed by camera position. |
| set_terrain_height_scale | Set what every height a map draws is multiplied by, about the surface its heights are measured from. Picks, heights read as drawn, cameras and ENU nodes on the ground follow it. 1 draws the ground at the height its source reports. |
| set_terrain_quality | Set the terrain detail of every map. Higher detail draws finer tiles and costs more GPU time and network traffic. The change applies from the next frame. |
| spawn_map | Spawn a map of streamed imagery and terrain into the scene as a node, and answer the node. |
| Type | Description |
|---|---|
| FlatProjection | The projection the flat map is drawn in. |
| MapAir | What the air around a map’s body is made of, in the units of physically based sky models: the scattering and absorption of the gas, its aerosol and its ozone for each meter of path, each over the red, green and blue channels, with the heights they thin over. |
| MapElevation | The common height reference used to combine elevation layers and report height samples. |
| MapState | The state of a map, as of the last drawn frame. |
| MapSurface | The figure and relief of the body a map is drawn on. |
| TerrainQuality | How much terrain detail the map draws. Higher draws finer tiles and costs more. |
get_ground_color
def get_ground_color(
*,
map: types.scene.Node,
_transaction_id: str | None = None
) -> types.color.ColorRgbRead the color a map’s ground is drawn in where no imagery layer covers it. Fails with
WrongNodeKind when map is not a map.
Returns ColorRgb.
map : Node
The node geo.map.spawn_map answered for the map.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_level_blend
def get_level_blend(*, map: types.scene.Node, _transaction_id: str | None = None) -> floatRead the part of the level blend band a map’s imagery blends across, as
geo.map.set_level_blend set it.
Fails with the WrongNodeKind error kind when map is not a map.
Returns float.
map : Node
The node geo.map.spawn_map answered for the map.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_map
def get_map(
*,
map: types.scene.Node,
_transaction_id: str | None = None
) -> types.geo.map.MapStateRead a map: how it is shown, its layers and how its streaming is going.
Fails with WrongNodeKind when map is not a map.
Returns MapState.
map : Node
The node geo.map.spawn_map answered for the map.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_maps
def get_maps(
*,
_transaction_id: str | None = None
) -> tuple[types.geo.map.MapState, ...]Read every map in the scene, in the order they were spawned, each as geo.map.get_map reads
it.
Returns tuple[MapState, ...].
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_terrain_geomorph
def get_terrain_geomorph(*, map: types.scene.Node, _transaction_id: str | None = None) -> boolRead whether a map draws its terrain heights morphed by camera position, as
geo.map.set_terrain_geomorph set it.
Fails with the WrongNodeKind error kind when map is not a map.
Returns bool.
map : Node
The node geo.map.spawn_map answered for the map.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
get_terrain_quality
def get_terrain_quality(
*,
_transaction_id: str | None = None
) -> types.geo.map.TerrainQuality | NoneRead the terrain detail every map draws at.
Returns nothing when the detail set matches none of the named levels.
Returns TerrainQuality | None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_air
def set_air(
*,
map: types.scene.Node,
air: types.geo.map.MapAir | None = None,
_transaction_id: str | None = None
) -> NoneSet the air around the body a map is drawn on, or none. Without air the ground takes the light above the air. Nothing is fetched again.
Fails with WrongNodeKind when map is not a map, and with InvalidArgument when air
holds a value that is not finite or out of range.
Returns None.
map : Node
The node geo.map.spawn_map answered for the map.
air optional : MapAir | None
The air. Absent, none. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_auto_exposure
def set_auto_exposure(
*,
map: types.scene.Node,
curve: types.geo.viewport.ExposureCurve | None = None,
albedo: float | None = None,
_transaction_id: str | None = None
) -> NoneGive one map a curve of its own, over its viewports’ curves, for an app that wants each body
to look its own way. Absent curve clears it, and the map takes its viewports’ curves again.
Fails with WrongNodeKind when map is not a map, and with InvalidArgument when the curve
is empty, a point’s lux or share is not a finite number above zero, the lux do not rise
strictly, or albedo is negative or not finite.
Returns None.
map : Node
The node geo.map.spawn_map answered for the map.
curve optional : ExposureCurve | None
How bright each amount of light on this map should look. Defaults to None.
albedo optional : float | None
The albedo of the reference ground the curve’s shares are for. Absent, the viewport’s. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_ground_color
def set_ground_color(
*,
map: types.scene.Node,
color: types.color.ColorRgb | None = None,
_transaction_id: str | None = None
) -> types.color.ColorRgbSet the color a map’s ground is drawn in where no imagery layer covers it, and answer the color now drawn there.
Every imagery layer is drawn over this color, so it shows wherever no layer has a tile and
wherever a layer’s tiles are clear, such as past the area a regional layer maps. A map starts
with the color geo.map.spawn_map was given, or a neutral gray. Fails with WrongNodeKind
when map is not a map.
Returns ColorRgb.
map : Node
The node geo.map.spawn_map answered for the map.
color optional : ColorRgb | None
sRGB color with 8-bit channels (0 to 255). Absent, a neutral gray. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_level_blend
def set_level_blend(
*,
map: types.scene.Node,
share: float,
_transaction_id: str | None = None
) -> NoneSet how sharply a map’s imagery changes from one level of detail to the next.
Where the detail a pixel needs lies between two levels, the map blends the two across a band.
share is the part of that band the map blends across: 1, the default, blends across the whole
band, and less switches between levels more sharply, which suits a map seen straight down.
Fails with the InvalidArgument error kind when share is not above 0 and at most 1, and with
WrongNodeKind when map is not a map.
Returns None.
map : Node
The node geo.map.spawn_map answered for the map.
share : float
The part of the blend band to blend across, above 0 and at most 1.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_surface
def set_surface(
*,
map: types.scene.Node,
surface: types.geo.map.MapSurface,
_transaction_id: str | None = None
) -> NoneSet the figure and relief of the body a map is drawn on. The map is drawn again on the new figure from the next frame, and the tiles it holds are kept.
Fails with WrongNodeKind when map is not a map, and with InvalidArgument when surface
describes no figure.
Returns None.
map : Node
The node geo.map.spawn_map answered for the map.
surface : MapSurface
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_terrain_geomorph
def set_terrain_geomorph(
*,
map: types.scene.Node,
enabled: bool,
_transaction_id: str | None = None
) -> NoneSet whether a map draws its terrain heights morphed by camera position.
With it on, the terrain blends smoothly from one level of detail to the next as the camera moves, tiles meet on one height along their edges, and elevation that arrives late blends in rather than popping. Off, the default, draws the terrain as it always has, so the two can be compared at runtime.
Fails with the WrongNodeKind error kind when map is not a map.
Returns None.
map : Node
The node geo.map.spawn_map answered for the map.
enabled : bool
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_terrain_height_scale
def set_terrain_height_scale(
*,
map: types.scene.Node,
exaggeration: float,
_transaction_id: str | None = None
) -> NoneSet what every height a map draws is multiplied by, about the surface its heights are measured from. Picks, heights read as drawn, cameras and ENU nodes on the ground follow it. 1 draws the ground at the height its source reports.
Fails with WrongNodeKind when map is not a map, and with InvalidArgument when
exaggeration is negative or not finite.
Returns None.
map : Node
The node geo.map.spawn_map answered for the map.
exaggeration : float
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_terrain_quality
def set_terrain_quality(
*,
quality: types.geo.map.TerrainQuality,
_transaction_id: str | None = None
) -> NoneSet the terrain detail of every map. Higher detail draws finer tiles and costs more GPU time and network traffic. The change applies from the next frame.
Returns None.
quality : TerrainQuality
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
spawn_map
def spawn_map(
*,
coordinate_crs: types.geo.CrsId | None = None,
view: types.geo.MapViewMode | None = None,
flat_projection: types.geo.map.FlatProjection | None = None,
terrain_quality: types.geo.map.TerrainQuality | None = None,
surface: types.geo.map.MapSurface | None = None,
air: types.geo.map.MapAir | None = None,
ground_color: types.color.ColorRgb | None = None,
terrain_height_scale: float | None = None,
elevation: types.geo.map.MapElevation | None = None,
_transaction_id: str | None = None
) -> types.scene.NodeSpawn a map of streamed imagery and terrain into the scene as a node, and answer the node.
The map stands at the scene origin with its north pole along the scene’s up axis, z, until its
transform is set with the scene.transform statements, which move, turn and scale it.
Every statement that acts on the map takes the answered node as map, and
scene.despawn removes the map with its layers, ENU nodes and paths. The map and every
statement that changes it change the scene only: nothing is saved with a project or undone,
and they work outside versioned mode.
The map is drawn on the ellipsoid surface describes, lit through the air air describes,
and its ground is drawn in ground_color where no imagery layer covers it.
Spawning a map does not change camera control. Geographic navigation acquires control of its selected camera. Despawning the map releases that control and preserves the camera’s world pose.
The map starts with no layers. Fails with InvalidArgument when surface or air holds a
value that is not finite or out of range, when the registry does not hold coordinate_crs, and
when coordinate_crs is on a body of another equatorial radius than surface.
Returns Node.
coordinate_crs optional : CrsId | None
Coordinates returned by map conversions, independent of globe or flat display mode. Absent, OGC:CRS84 on the Earth. A map of another body requires the code of that body’s geographic system, such as IAU_2015:49900, which the registry has to hold: register its definition with geo.crs.register first. OGC:CRS84 then names longitude and latitude on the map’s own figure. Defaults to None.
view optional : MapViewMode | None
Absent, the globe. Defaults to None.
flat_projection optional : FlatProjection | None
The projection the flat map is drawn in. Absent, Web Mercator. Defaults to None.
terrain_quality optional : TerrainQuality | None
The terrain detail of every map. Absent, the detail already set, which starts at medium. Defaults to None.
surface optional : MapSurface | None
The figure and relief of the body to map. Its equatorial radius has to match the figure of coordinate_crs on another body. Absent, the figure coordinate_crs names, or the WGS 84 Earth, with the Earth’s lowest and highest ground. Defaults to None.
air optional : MapAir | None
The air around the body. Absent, none, and the ground takes the light above the air. Defaults to None.
ground_color optional : ColorRgb | None
sRGB color with 8-bit channels (0 to 255) the ground is drawn in where no imagery layer covers it. Absent, a neutral gray. Defaults to None.
terrain_height_scale optional : float | None
What every height the map draws is multiplied by, about the surface its heights are measured from. Absent, 1. Defaults to None.
elevation optional : MapElevation | None
The common elevation reference. Absent, heights above a geoid with no geoid model, which no terrain can be placed in: the map draws its imagery on the body’s figure and refuses elevation layers. Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
FlatProjection
Enum
class FlatProjection(IntEnum)The projection the flat map is drawn in.
Values: WEB_MERCATOR = 0 EPSG:3857, which stretches the ground toward the poles and cuts them off. PLATE_CARREE = 1 Longitude and latitude drawn as plain x and y.
WEB_MERCATOR = 0
EPSG:3857, which stretches the ground toward the poles and cuts them off.
PLATE_CARREE = 1
Longitude and latitude drawn as plain x and y.
MapAir
MapAir(
*,
rayleigh_scattering: types.math.Vec3,
rayleigh_scale_height: float,
mie_scattering: types.math.Vec3,
mie_absorption: types.math.Vec3,
mie_scale_height: float,
mie_g: types.math.Vec3,
mie_peak_g: types.math.Vec3,
mie_peak_share: types.math.Vec3,
mie_scattering_exponent: float,
mie_absorption_exponent: float,
mie_soot: float,
atmosphere_height: float,
ozone_absorption: types.math.Vec3,
ozone_layer_altitude: float,
ozone_layer_half_width: float,
ground_albedo: types.math.Vec3
)What the air around a map’s body is made of, in the units of physically based sky models: the scattering and absorption of the gas, its aerosol and its ozone for each meter of path, each over the red, green and blue channels, with the heights they thin over.
rayleigh_scattering : Vec3
Rayleigh scattering of the gas at the ground, for each meter.
rayleigh_scale_height : float
Meters over which the gas thins by a factor of e.
mie_scattering : Vec3
Scattering of the aerosol at the ground, for each meter.
mie_absorption : Vec3
Absorption of the aerosol at the ground, for each meter.
mie_scale_height : float
Meters over which the aerosol thins by a factor of e.
mie_g : Vec3
The Cornette and Shanks asymmetry of the aerosol’s phase function, between -1, backward, and 1, forward, with 0 even. Where mie_peak_share is above zero, this is the broad lobe only.
mie_peak_g : Vec3
The asymmetry of a second, narrow lobe of the aerosol’s phase function, between -1 and 1.
mie_peak_share : Vec3
The share of the aerosol’s scattered light in the lobe at mie_peak_g, from 0 to 1.
mie_scattering_exponent : float
The power of the wavelength the aerosol’s scattering falls with. Zero is grey.
mie_absorption_exponent : float
The power of the wavelength the aerosol’s absorption falls with.
mie_soot : float
The share of mie_scattering the aerosol absorbs instead of scattering, as soot does.
atmosphere_height : float
The height of the top of the air over the ground, in meters.
ozone_absorption : Vec3
Absorption of the ozone at the middle of its band, for each meter.
ozone_layer_altitude : float
The height of the middle of the ozone band, in meters.
ozone_layer_half_width : float
Meters from the middle of the ozone band to where it thins to nothing, both ways.
ground_albedo : Vec3
The share of sunlight the ground throws back into the air.
MapElevation
MapElevation(*, reference: types.geo.ElevationReference)The common height reference used to combine elevation layers and report height samples.
reference : ElevationReference
Orthometric heights need a geoid model, so an orthometric reference without one is refused. An elevation layer whose reference cannot be converted to this one is refused too.
MapState
MapState(
*,
coordinate_crs: types.geo.CrsId,
node: types.scene.Node,
surface: types.geo.map.MapSurface,
view: types.geo.MapViewMode,
morph: float,
layers: tuple[types.geo.map.layer.LayerInfo, ...] = (),
requests_in_flight: int,
drawn_tiles: int,
error: str | None = None,
elevation_reference: types.geo.ElevationReference | None = None
)The state of a map, as of the last drawn frame.
coordinate_crs : CrsId
The coordinate CRS used by position results, independent of the display projection.
node : Node
The map’s node, as geo.map.spawn_map answered it.
surface : MapSurface
The figure and relief of the body the map is drawn on.
view : MapViewMode
The view shown, or the view a change in progress heads for.
morph : float
How far the map has morphed from the globe, 0, toward the flat map, 1.
layers optional : tuple[LayerInfo, ...]
Every layer of the map in draw order: imagery bottom first, then elevation bottom first. Defaults to ().
requests_in_flight : int
Tile requests the map is waiting on.
drawn_tiles : int
Tiles drawn in the last frame.
error optional : str | None
Why the map could not be drawn with its current settings, such as when a build runs no map workers. Absent while it draws. Defaults to None.
elevation_reference optional : ElevationReference | None
Defaults to None.
MapSurface
MapSurface(
*,
equatorial_radius: float,
polar_radius: float,
lowest_ground: float,
highest_ground: float
)The figure and relief of the body a map is drawn on.
equatorial_radius : float
The radius at the equator, the ellipsoid’s semi-major axis, in meters. Positive and finite.
polar_radius : float
The radius at either pole, in meters. Positive and no greater than the equatorial radius.
lowest_ground : float
The lowest ground on the body, in meters over the figure, assumed until elevation loads. Negative where ground stands under the figure.
highest_ground : float
The highest ground on the body, in meters over the figure, assumed until elevation loads. No lower than lowest_ground.
TerrainQuality
Enum
class TerrainQuality(IntEnum)How much terrain detail the map draws. Higher draws finer tiles and costs more.
Values: LOW = 0 MEDIUM = 1 HIGH = 2
LOW = 0
MEDIUM = 1
HIGH = 2