Skip to content

geo.map.layer

19 functions / 21 types

Index

FunctionDescription
add_arcgis_layerAdd a layer from the tile cache of an ArcGIS MapServer or ImageServer.
add_service_layerAdd a discovered dataset to a map without fetching service metadata again. Returns an independent map-layer UUID. Service credentials apply to its tile requests.
add_wmts_layerAdd a layer of a WMTS service, read from its capabilities document.
add_xyz_layerAdd a layer of slippy map tiles named by a URL template.
get_colorRead the color an imagery layer’s own tiles hold at a place, from the tiles the map has loaded.
get_feature_infoAsk each layer’s service what it holds at a place, through the service’s GetFeatureInfo.
get_layersList the map’s layers in draw order: imagery bottom first, then elevation bottom first.
move_downExecute the move_down statement.
move_upExecute the move_up statement.
remove_allTake every layer off the map. The map stays, and the cameras stay on it, over a bare globe or flat map.
remove_layerTake a layer off the map. The map keeps drawing every other layer without fetching them again.
set_authReplace the credentials a layer sends with its source’s document request and every tile request. The map reads the layer’s source again with the new credentials.
set_emissionDraw an imagery layer as light it gives off, or as ground the sun lights again.
set_indexMove a layer to another place among the layers of its role, and list every layer.
set_opacitySet how opaque an imagery layer draws over the layers under it.
set_placeholder_detectionEnable or disable placeholder tile detection for one service layer.
set_timePin a layer with a time axis to one date, or let it follow the scene clock again.
set_transparent_colorDraw one color of an imagery layer clear, or draw every color again.
set_visibleShow or hide a layer. A hidden layer stops fetching, and the layers under it show through.
TypeDescription
ColorEncodingWhat the color values of an imagery layer’s pixels stand for.
ElevationEncodingHow an elevation tile stores its heights.
ElevationOptionsHow an elevation layer decodes and interprets its samples.
ElevationSamplesWhere a tile’s height samples sit.
FeatureInfoWhat one layer’s service answered about a place, as geo.map.layer.get_feature_info reports it.
FollowClockFollowClock
GeoBoundsA box in degrees of longitude and latitude. west is greater than east for a box that crosses the antimeridian.
KeyValueOne name and value pair.
LayerColorThe color an imagery layer’s own tiles hold at a place.
LayerColorSampleWhat geo.map.layer.get_color found for one imagery layer at a place.
LayerDatesThe dates a layer with a time axis offers, and the one it shows.
LayerIdA map-owned layer’s stable UUID, independent of its provider identifier and draw order.
LayerInfoOne layer of the map.
LayerRoleWhat a layer gives the map.
LayerStateWhether the map has read a layer’s source and can draw it.
NotCoveredThe layer serves no tile at the place.
NotLoadedThe layer serves the place, but no tile over it has loaded at any level.
ResamplingHow an imagery layer’s pixels are read between their centers.
TileAuthCredentials a layer sends with every request it makes.
TimeSelectionSelect dataset time independently of the viewport’s sunlight configuration.
TransparentColorA color an imagery layer draws clear, for a service that fills the ground it has no data for with a solid color, as a JPEG service must.

add_arcgis_layer

def add_arcgis_layer(
    *,
    map: types.scene.Node,
    service_url: str,
    role: types.geo.map.layer.LayerRole | None = None,
    elevation: types.geo.map.layer.ElevationOptions | None = None,
    auth: types.geo.map.layer.TileAuth | None = None,
    opacity: float | None = None,
    name: str | None = None,
    color_encoding: types.geo.map.layer.ColorEncoding | None = None,
    emission: float | None = None,
    black_point: float | None = None,
    resampling: types.geo.map.layer.Resampling | None = None,
    attribution: str | None = None,
    detect_placeholders: bool | None = None,
    publication_delay_seconds: float | None = None,
    known_placeholder_hashes: list[str] | None = None,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerId

Add a layer from the tile cache of an ArcGIS MapServer or ImageServer.

The service describes its own grid and levels. An elevation service that serves LERC is read as LERC with corner samples unless elevation says otherwise. The layer goes on top of the layers of its role, and the map reads the service once the layer is added.

Returns the layer UUID before reading the source. Poll geo.map.layer.get_layers for its state and error. A service that cannot be reached or read leaves the saved layer in Failed. Fails when map does not name a map.

Returns LayerId.

map : Node

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

service_url : str

The service URL, ending in MapServer or ImageServer.

role optional : LayerRole | None

Absent, imagery. Defaults to None.

elevation optional : ElevationOptions | None

What the heights mean, for an elevation layer. Defaults to None.

auth optional : TileAuth | None

Credentials of your own, sent with the service request and every tile request. Defaults to None.

opacity optional : float | None

From 0, invisible, to 1, opaque. Absent, 1. Elevation layers ignore it. Defaults to None.

name optional : str | None

The name the layer is listed under. Absent, the name the service gives itself. Defaults to None.

color_encoding optional : ColorEncoding | None

What the imagery’s pixel values stand for. Absent, sRGB color. Elevation layers ignore it. Defaults to None.

emission optional : float | None

The radiance, in candela per square meter, of a full white pixel of imagery whose color is light it gives off, which is added to the lit ground so it shows where no sun falls. Absent or 0, the sun lights the layer. Elevation layers ignore it. Defaults to None.

black_point optional : float | None

The linear luminance, from 0 up to but not including 1, at or below which a pixel of emissive imagery gives off no light. A brighter pixel gives off light in proportion to its luminance above the black point, so a full white pixel still gives off the whole emission. Absent, 0. Defaults to None.

resampling optional : Resampling | None

How the imagery’s pixels are read between their centers. Absent, bilinear. Elevation layers ignore it. Defaults to None.

attribution optional : str | None

The credit the tiles ask for. Absent, the one the service states, if any. Defaults to None.

detect_placeholders optional : bool | None

Enables placeholder tile detection. Absent, enabled. Detection can reject valid repeated tiles; disable it for services that intentionally repeat imagery or heights. Defaults to None.

publication_delay_seconds optional : float | None

Optional publication delay for clock-following dataset selections, in seconds. Defaults to None.

known_placeholder_hashes optional : list[str] | None

Encoded missing-data tile hashes, each written as fnv1a64: and 16 hex digits. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

add_service_layer

def add_service_layer(
    *,
    map: types.scene.Node,
    layer: types.geo.ServiceLayerId,
    selection: types.geo.ServiceLayerSelection | None = None,
    role: types.geo.map.layer.LayerRole | None = None,
    elevation: types.geo.map.layer.ElevationOptions | None = None,
    opacity: float | None = None,
    name: str | None = None,
    color_encoding: types.geo.map.layer.ColorEncoding | None = None,
    resampling: types.geo.map.layer.Resampling | None = None,
    emission: float | None = None,
    black_point: float | None = None,
    finest_level: int | None = None,
    attribution: str | None = None,
    detect_placeholders: bool | None = None,
    publication_delay_seconds: float | None = None,
    known_placeholder_hashes: list[str] | None = None,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerId

Add a discovered dataset to a map without fetching service metadata again. Returns an independent map-layer UUID. Service credentials apply to its tile requests.

Returns the layer UUID before the map builds the layer. Poll geo.map.layer.get_layers for its state and error. A dataset the map cannot draw, such as one whose tile matrix sets are all in a coordinate reference system the engine does not hold, leaves the saved layer in Failed, and it draws once geo.crs.register registers that system. Fails when map does not name a map, or the service or dataset does not exist.

Returns LayerId.

map : Node

selection optional : ServiceLayerSelection | None

Defaults to None.

role optional : LayerRole | None

Defaults to None.

elevation optional : ElevationOptions | None

Defaults to None.

opacity optional : float | None

Defaults to None.

name optional : str | None

Defaults to None.

color_encoding optional : ColorEncoding | None

Defaults to None.

resampling optional : Resampling | None

Defaults to None.

emission optional : float | None

Defaults to None.

black_point optional : float | None

Defaults to None.

finest_level optional : int | None

Defaults to None.

attribution optional : str | None

Defaults to None.

detect_placeholders optional : bool | None

Defaults to None.

publication_delay_seconds optional : float | None

Defaults to None.

known_placeholder_hashes optional : list[str] | None

Encoded missing-data tile hashes, each written as fnv1a64: and 16 hex digits. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

add_wmts_layer

def add_wmts_layer(
    *,
    map: types.scene.Node,
    capabilities_url: str,
    provider_layer_id: types.geo.ProviderLayerId | None = None,
    tile_matrix_set_id: types.geo.TileMatrixSetId | None = None,
    style_id: types.geo.StyleId | None = None,
    format: types.geo.MediaType | None = None,
    role: types.geo.map.layer.LayerRole | None = None,
    elevation: types.geo.map.layer.ElevationOptions | None = None,
    auth: types.geo.map.layer.TileAuth | None = None,
    opacity: float | None = None,
    name: str | None = None,
    color_encoding: types.geo.map.layer.ColorEncoding | None = None,
    emission: float | None = None,
    black_point: float | None = None,
    resampling: types.geo.map.layer.Resampling | None = None,
    finest_level: int | None = None,
    attribution: str | None = None,
    detect_placeholders: bool | None = None,
    publication_delay_seconds: float | None = None,
    known_placeholder_hashes: list[str] | None = None,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerId

Add a layer of a WMTS service, read from its capabilities document.

The layer goes on top of the layers of its role. The map reads the document once the layer is added, and a document read before with the same credentials, such as by geo.catalog.get_wmts_layers, is not fetched again. A layer with a time axis follows the scene clock until geo.map.layer.set_time pins it to a date.

Returns the layer UUID before reading the source. Poll geo.map.layer.get_layers for its state and error. A document that cannot be reached or read, or that does not declare the layer, leaves the saved layer in Failed. Fails when map does not name a map.

Returns LayerId.

map : Node

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

capabilities_url : str

The URL of the service’s capabilities document.

provider_layer_id optional : ProviderLayerId | None

The identifier of the layer to draw. Absent, the layer the service opens on. Defaults to None.

tile_matrix_set_id optional : TileMatrixSetId | None

The tile matrix set to draw on. Absent, the first one the layer links that can be drawn. Defaults to None.

style_id optional : StyleId | None

Absent, the layer’s default style. Defaults to None.

format optional : MediaType | None

The tile media type. Absent, the first one the layer offers that can be decoded, or for elevation the one that holds heights. Defaults to None.

role optional : LayerRole | None

Absent, imagery. Defaults to None.

elevation optional : ElevationOptions | None

What the heights mean. Needed when role is elevation, unless the layer’s format is LERC or its name says Terrarium or Terrain-RGB. Defaults to None.

auth optional : TileAuth | None

Credentials of your own, sent with the capabilities request and every tile request. Defaults to None.

opacity optional : float | None

From 0, invisible, to 1, opaque. Absent, 1. Elevation layers ignore it. Defaults to None.

name optional : str | None

The name the layer is listed under. Absent, the title the service gives it. Defaults to None.

color_encoding optional : ColorEncoding | None

What the imagery’s pixel values stand for. Absent, sRGB color. Elevation layers ignore it. Defaults to None.

emission optional : float | None

The radiance, in candela per square meter, of a full white pixel of imagery whose color is light it gives off, which is added to the lit ground so it shows where no sun falls. Absent or 0, the sun lights the layer. Elevation layers ignore it. Defaults to None.

black_point optional : float | None

The linear luminance, from 0 up to but not including 1, at or below which a pixel of emissive imagery gives off no light. A brighter pixel gives off light in proportion to its luminance above the black point, so a full white pixel still gives off the whole emission. Absent, 0. Defaults to None.

resampling optional : Resampling | None

How the imagery’s pixels are read between their centers. Absent, bilinear. Elevation layers ignore it. Defaults to None.

finest_level optional : int | None

The deepest level to fetch, for a service that serves deeper levels only as this one enlarged. The map enlarges it itself, smoothly and without fetching more. Absent, every level the layer declares. Defaults to None.

attribution optional : str | None

The credit the tiles ask for, since a capabilities document has no field for one. Defaults to None.

detect_placeholders optional : bool | None

Enables placeholder tile detection. Absent, enabled. Detection can reject valid repeated tiles; disable it for services that intentionally repeat imagery or heights. Defaults to None.

publication_delay_seconds optional : float | None

Optional publication delay for clock-following dataset selections, in seconds. Defaults to None.

known_placeholder_hashes optional : list[str] | None

Encoded missing-data tile hashes, each written as fnv1a64: and 16 hex digits. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

add_xyz_layer

def add_xyz_layer(
    *,
    subdomains: list[str] | None = None,
    map: types.scene.Node,
    template: types.geo.TileUrlTemplate,
    min_zoom: int | None = None,
    max_zoom: int | None = None,
    tile_size: int | None = None,
    role: types.geo.map.layer.LayerRole | None = None,
    elevation: types.geo.map.layer.ElevationOptions | None = None,
    auth: types.geo.map.layer.TileAuth | None = None,
    opacity: float | None = None,
    name: str | None = None,
    attribution: str | None = None,
    color_encoding: types.geo.map.layer.ColorEncoding | None = None,
    emission: float | None = None,
    black_point: float | None = None,
    resampling: types.geo.map.layer.Resampling | None = None,
    detect_placeholders: bool | None = None,
    publication_delay_seconds: float | None = None,
    known_placeholder_hashes: list[str] | None = None,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerId

Add a layer of slippy map tiles named by a URL template.

The template holds {z}, {x} and {y}, and the tiles are taken to be on the Web Mercator quad with row 0 at the top, which is the grid that form describes. The layer goes on top of the layers of its role.

Returns the layer UUID. Poll geo.map.layer.get_layers for source configuration failures. Ready means the configuration was accepted, not that tiles were fetched. A template that answers nothing shows missing tiles and can still report Ready.

Returns LayerId.

subdomains optional : list[str] | None

Host labels used for {s}. Single-character ranges such as {a-c} need no list. Defaults to None.

map : Node

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

template : TileUrlTemplate

The tile URL, with {z}, {x} and {y} where the level, column and row go.

min_zoom optional : int | None

The coarsest level served. Absent, 0. Defaults to None.

max_zoom optional : int | None

The deepest level served. Absent, 19. Defaults to None.

tile_size optional : int | None

Pixels along a tile’s side. Absent, 256. Defaults to None.

role optional : LayerRole | None

Absent, imagery. Defaults to None.

elevation optional : ElevationOptions | None

What the heights mean. Needed when role is elevation. Defaults to None.

auth optional : TileAuth | None

Credentials of your own, sent with every tile request. Defaults to None.

opacity optional : float | None

From 0, invisible, to 1, opaque. Absent, 1. Elevation layers ignore it. Defaults to None.

name optional : str | None

The name the layer is listed under. Absent, the host the template names. Defaults to None.

attribution optional : str | None

The credit the tiles ask for. Defaults to None.

color_encoding optional : ColorEncoding | None

What the imagery’s pixel values stand for. Absent, sRGB color. Elevation layers ignore it. Defaults to None.

emission optional : float | None

The radiance, in candela per square meter, of a full white pixel of imagery whose color is light it gives off, which is added to the lit ground so it shows where no sun falls. Absent or 0, the sun lights the layer. Elevation layers ignore it. Defaults to None.

black_point optional : float | None

The linear luminance, from 0 up to but not including 1, at or below which a pixel of emissive imagery gives off no light. A brighter pixel gives off light in proportion to its luminance above the black point, so a full white pixel still gives off the whole emission. Absent, 0. Defaults to None.

resampling optional : Resampling | None

How the imagery’s pixels are read between their centers. Absent, bilinear. Elevation layers ignore it. Defaults to None.

detect_placeholders optional : bool | None

Enables placeholder tile detection. Absent, enabled. Detection can reject valid repeated tiles; disable it for services that intentionally repeat imagery or heights. Defaults to None.

publication_delay_seconds optional : float | None

Optional publication delay for clock-following dataset selections, in seconds. Defaults to None.

known_placeholder_hashes optional : list[str] | None

Encoded missing-data tile hashes, each written as fnv1a64: and 16 hex digits. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

get_color

def get_color(
    *,
    map: types.scene.Node,
    layer_id: types.geo.map.layer.LayerId,
    position: types.geo.GeoPosition,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerColorSample

Read the color an imagery layer’s own tiles hold at a place, from the tiles the map has loaded.

The color is the tile’s pixel as decoded, before the layer’s opacity, emission and transparent color, before light, and before the layers above and below it. So a categorical map, such as a geological map, answers one of the colors its legend lists, whether or not its service answers geo.map.layer.get_feature_info. The finest tile the layer serves at the place answers where it has loaded, and otherwise the nearest coarser tile that has, which a level less than finest_level reports. Nothing is fetched and nothing the map draws changes.

Answers NotCovered where the layer serves no tile, and NotLoaded where no tile over the place has loaded yet, such as while the layer’s source is still being read. A hidden layer answers from the tiles it still holds. Fails when map is not a map, when layer_id is not one of its layers, or when the layer is an elevation layer.

Returns LayerColorSample.

map : Node

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

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

position : GeoPosition

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

get_feature_info

def get_feature_info(
    *,
    map: types.scene.Node,
    position: types.geo.GeoPosition,
    _transaction_id: str | None = None
) -> tuple[types.geo.map.layer.FeatureInfo, ...]

Ask each layer’s service what it holds at a place, through the service’s GetFeatureInfo.

Only layers whose service declares GetFeatureInfo and that cover the place answer, so a map of plain tiles answers with an empty list. A layer whose service fails to answer is left out. The place must be on ground the map has loaded, and the answer is empty while the map morphs between the globe and the flat map. Fails when no map is spawned.

Returns tuple[FeatureInfo, ...].

map : Node

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

position : GeoPosition

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

get_layers

def get_layers(
    *,
    map: types.scene.Node,
    _transaction_id: str | None = None
) -> tuple[types.geo.map.layer.LayerInfo, ...]

List the map’s layers in draw order: imagery bottom first, then elevation bottom first.

Poll state after layer creation. Ready means the source is configured, not that every tile has loaded. Source configuration failures leave the layer saved with state set to Failed and the reason in error. Individual tile failures do not change the layer’s state.

Returns tuple[LayerInfo, ...].

map : Node

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

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

move_down

def move_down(
    *,
    layer_id: types.geo.map.layer.LayerId,
    _transaction_id: str | None = None
) -> tuple[types.geo.map.layer.LayerInfo, ...]

Execute the move_down statement.

Returns tuple[LayerInfo, ...].

layer_id : LayerId

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

move_up

def move_up(
    *,
    layer_id: types.geo.map.layer.LayerId,
    _transaction_id: str | None = None
) -> tuple[types.geo.map.layer.LayerInfo, ...]

Execute the move_up statement.

Returns tuple[LayerInfo, ...].

layer_id : LayerId

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

remove_all

def remove_all(*, map: types.scene.Node, _transaction_id: str | None = None) -> None

Take every layer off the map. The map stays, and the cameras stay on it, over a bare globe or flat map.

Returns None.

map : Node

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

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

remove_layer

def remove_layer(
    *,
    layer_id: types.geo.map.layer.LayerId,
    _transaction_id: str | None = None
) -> None

Take a layer off the map. The map keeps drawing every other layer without fetching them again.

Returns None.

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_auth

def set_auth(
    *,
    layer_id: types.geo.map.layer.LayerId,
    auth: types.geo.map.layer.TileAuth,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerInfo

Replace the credentials a layer sends with its source’s document request and every tile request. The map reads the layer’s source again with the new credentials.

Returns LayerInfo.

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

auth : TileAuth

The credentials to send. Empty lists send none.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_emission

def set_emission(
    *,
    layer_id: types.geo.map.layer.LayerId,
    emission: float | None = None,
    black_point: float | None = None,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerInfo

Draw an imagery layer as light it gives off, or as ground the sun lights again.

An emissive layer’s color, times its radiance, is added to the lit ground rather than laid over it, so it shows where no sun falls and is lost beside ground in full daylight. It neither hides the layers under it nor is hidden by the ones above, and its opacity scales its light.

Returns LayerInfo.

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

emission optional : float | None

The radiance, in candela per square meter, of a full white pixel. Absent or 0, the sun lights the layer. Elevation layers ignore it. Defaults to None.

black_point optional : float | None

The linear luminance, from 0 up to but not including 1, at or below which a pixel gives off no light. A brighter pixel gives off light in proportion to its luminance above the black point, so a full white pixel still gives off the whole emission. Absent, 0. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_index

def set_index(
    *,
    layer_id: types.geo.map.layer.LayerId,
    index: int,
    _transaction_id: str | None = None
) -> tuple[types.geo.map.layer.LayerInfo, ...]

Move a layer to another place among the layers of its role, and list every layer.

Imagery draws from the bottom up. The top elevation layer gives the ground its height wherever it has data.

Returns tuple[LayerInfo, ...].

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

index : int

The place among the layers of its role, 0 being the bottom. Past the top, the top.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_opacity

def set_opacity(
    *,
    layer_id: types.geo.map.layer.LayerId,
    opacity: float,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerInfo

Set how opaque an imagery layer draws over the layers under it.

Returns LayerInfo.

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

opacity : float

From 0, invisible, to 1, opaque. Elevation layers ignore it.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_placeholder_detection

def set_placeholder_detection(
    *,
    layer_id: types.geo.map.layer.LayerId,
    enabled: bool,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerInfo

Enable or disable placeholder tile detection for one service layer.

Enabled by default. Detection classifies repeated nonuniform tiles as placeholders and can reject valid repeated imagery or heights. Disabling it makes previously rejected tiles eligible for fetching again. HTTP missing responses and nodata samples retain their normal behavior.

Returns LayerInfo.

layer_id : LayerId

enabled : bool

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_time

def set_time(
    *,
    layer_id: types.geo.map.layer.LayerId,
    selection: types.geo.map.layer.TimeSelection,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerInfo

Pin a layer with a time axis to one date, or let it follow the scene clock again.

Select the layer’s dataset time independently of sunlight.

The layer shows the latest advertised time at or before the selected instant, clamped to its available range. FollowClock uses the scene clock. Pinned requires an RFC 3339 timestamp with a UTC offset. A layer without a time axis retains the selection without changing tiles.

Returns LayerInfo.

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

selection : TimeSelection

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_transparent_color

def set_transparent_color(
    *,
    layer_id: types.geo.map.layer.LayerId,
    color: types.color.ColorRgb | None = None,
    tolerance: int | None = None,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerInfo

Draw one color of an imagery layer clear, or draw every color again.

This is for a service that fills the ground it has no data for with a solid color, as a JPEG service must, which otherwise hides every layer under the layer there. Pixels of the color draw clear and the layers under them show through. A layer with a transparent color never hides the layers under it, so they are always fetched and drawn. Where the map blends a pixel of the color with a pixel of data, as it does along the edge of the data and when the layer is seen from far away, the blend is kept, so a faint fringe of the color can show there. Elevation layers ignore it.

Returns LayerInfo.

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

color optional : ColorRgb | None

The color to draw clear, as the layer’s pixels write it, with 8-bit channels (0 to 255), such as 255, 255, 255 for white. Absent, the layer draws every color again. Defaults to None.

tolerance optional : int | None

How many 8-bit steps, from 0 to 255, each channel of a pixel may lie from color for the pixel to draw clear. A larger value clears more of the fill but also clears imagery close to its color. Absent, 4. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_visible

def set_visible(
    *,
    layer_id: types.geo.map.layer.LayerId,
    visible: bool,
    _transaction_id: str | None = None
) -> types.geo.map.layer.LayerInfo

Show or hide a layer. A hidden layer stops fetching, and the layers under it show through.

Returns LayerInfo.

layer_id : LayerId

The layer’s id from geo.map.layer.get_layers.

visible : bool

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

ColorEncoding

Enum

class ColorEncoding(IntEnum)

What the color values of an imagery layer’s pixels stand for.

Values: SRGB = 0 sRGB encoded color, as photographs and drawn maps are published. LINEAR = 1 Values that rise in proportion to the light, as measured data such as a reflectance mosaic is often stretched to. A value from 0 to 255 stands for that share of full intensity.

SRGB = 0

sRGB encoded color, as photographs and drawn maps are published.

LINEAR = 1

Values that rise in proportion to the light, as measured data such as a reflectance mosaic is often stretched to. A value from 0 to 255 stands for that share of full intensity.

ElevationEncoding

Enum

class ElevationEncoding(IntEnum)

How an elevation tile stores its heights.

Values: LERC = 0 Esri’s LERC compression. TERRAIN_RGB = 1 Mapbox Terrain-RGB PNG. TERRARIUM = 2 Terrarium PNG. FLOAT32 = 3 Raw little endian 32 bit floats.

LERC = 0

Esri’s LERC compression.

TERRAIN_RGB = 1

Mapbox Terrain-RGB PNG.

TERRARIUM = 2

Terrarium PNG.

FLOAT32 = 3

Raw little endian 32 bit floats.

ElevationOptions

ElevationOptions(
    *,
    encoding: types.geo.map.layer.ElevationEncoding | None = None,
    samples: types.geo.map.layer.ElevationSamples | None = None,
    datum: types.geo.VerticalDatum | None = None,
    unit_scale: float | None = None,
    vertical_offset: float | None = None,
    geoid_model: types.geo.GeoidModelId | None = None,
    vertical_crs: types.geo.VerticalCrsId | None = None,
    reference_assumed: bool | None = None
)

How an elevation layer decodes and interprets its samples.

encoding optional : ElevationEncoding | None

How a tile stores its heights. Absent, the encoding the service declares; required for a service that declares none. An ArcGIS service that serves LERC is read as LERC whatever this says. Defaults to None.

samples optional : ElevationSamples | None

Where the samples sit. Absent, LERC samples sit on the corners and every other encoding on the pixel centers. Defaults to None.

datum optional : VerticalDatum | None

What the heights are measured from. Required: a layer without it is refused with InvalidArgument, because a wrong guess places the terrain tens of meters off. When the source does not say, state your guess and set reference_assumed. Defaults to None.

unit_scale optional : float | None

Multiplies every decoded height. Absent, one. Defaults to None.

vertical_offset optional : float | None

Added to every height after scaling, in meters. Absent, zero. Defaults to None.

geoid_model optional : GeoidModelId | None

The geoid the orthometric heights refer to. Orthometric heights without one cannot be placed, so the map refuses them. Defaults to None.

vertical_crs optional : VerticalCrsId | None

Defaults to None.

reference_assumed optional : bool | None

Whether datum and geoid_model are your guess rather than what the source states. The heights are converted the same either way. Every height read from the layer reports the assumption. Absent, false. Defaults to None.

ElevationSamples

Enum

class ElevationSamples(IntEnum)

Where a tile’s height samples sit.

Values: CORNERS = 0 On the tile corners, so neighboring tiles share their edge samples. CENTERS = 1 At the pixel centers.

CORNERS = 0

On the tile corners, so neighboring tiles share their edge samples.

CENTERS = 1

At the pixel centers.

FeatureInfo

FeatureInfo(*, layer: str, content_type: str, body: str)

What one layer’s service answered about a place, as geo.map.layer.get_feature_info reports it.

layer : str

The name the layer is listed under.

content_type : str

The media type the layer asks its service to answer in, such as text/html.

body : str

The service’s answer, as text.

FollowClock

FollowClock()

FollowClock

GeoBounds

GeoBounds(*, west: float, south: float, east: float, north: float)

A box in degrees of longitude and latitude. west is greater than east for a box that crosses the antimeridian.

west : float

south : float

east : float

north : float

KeyValue

KeyValue(*, key: str, value: str)

One name and value pair.

key : str

value : str

LayerColor

LayerColor(*, color: types.color.ColorRgba, level: int, finest_level: int)

The color an imagery layer’s own tiles hold at a place.

color : ColorRgba

The pixel of the tile under the place, as the tile was decoded: before the layer’s opacity, emission and transparent color, before light, and before the layers above and below it.

level : int

The tile matrix level the pixel was read from, 0 being the coarsest.

finest_level : int

The finest level the layer serves at the place. A level less than this means the finer tile has not loaded and a coarser one answered.

LayerColorSample

LayerColorSample()

What geo.map.layer.get_color found for one imagery layer at a place.

Construct one of the nested classes. Use isinstance to check its type.

LayerColorSample.Color

LayerColorSample.Color(value: types.geo.map.layer.LayerColor)

LayerColorSample.Color

value : LayerColor

LayerColorSample.NotCovered

LayerColorSample.NotCovered(value: types.geo.map.layer.NotCovered)

LayerColorSample.NotCovered

value : NotCovered

LayerColorSample.NotLoaded

LayerColorSample.NotLoaded(value: types.geo.map.layer.NotLoaded)

LayerColorSample.NotLoaded

value : NotLoaded

LayerDates

LayerDates(
    *,
    date: str | None = None,
    first: str,
    last: str,
    step: str | None = None
)

The dates a layer with a time axis offers, and the one it shows.

A layer that follows the clock shows the latest date its service offers at or before the clock’s time, held between first and last.

date optional : str | None

The date the layer shows, written as its service writes dates, such as 2024-06-12. Absent until the map has picked one. Defaults to None.

first : str

The earliest date the service offers.

last : str

The latest date the service advertises.

step optional : str | None

The time between dates as an ISO 8601 duration, such as P1D for a daily layer. Absent when the service lists its dates one by one. Defaults to None.

LayerId

LayerId(*, uuid: str)

A map-owned layer’s stable UUID, independent of its provider identifier and draw order.

uuid : str

LayerInfo

LayerInfo(
    *,
    layer_id: types.geo.map.layer.LayerId,
    name: str,
    role: types.geo.map.layer.LayerRole,
    opacity: float,
    visible: bool,
    source: str,
    attribution: str | None = None,
    state: types.geo.map.layer.LayerState,
    error: str | None = None,
    dates: types.geo.map.layer.LayerDates | None = None,
    time: types.geo.map.layer.TimeSelection,
    emission: float | None = None,
    black_point: float | None = None,
    area: types.geo.map.layer.GeoBounds | None = None,
    transparent_color: types.geo.map.layer.TransparentColor | None = None,
    detect_placeholders: bool,
    elevation_reference: types.geo.ElevationReference | None = None,
    legend_url: str | None = None
)

One layer of the map.

layer_id : LayerId

The handle the geo.map.layer statements take. It stays the same for the life of the layer, and no other layer of the map ever gets it.

name : str

The name given when the layer was spawned, or else the name its source gives it once the source has been read.

role : LayerRole

opacity : float

From 0, invisible, to 1, opaque. Elevation layers always report 1.

visible : bool

source : str

The service URL or tile template the layer was spawned from.

attribution optional : str | None

The credit the source asks for, where it states one. Defaults to None.

state : LayerState

error optional : str | None

Why source configuration failed, when state is failed. Defaults to None.

dates optional : LayerDates | None

The dates the layer can show and the one it shows, for a layer whose source has been read and declares a time axis. Defaults to None.

time : TimeSelection

The requested time selection. dates.date reports the provider’s selected dataset value.

emission optional : float | None

The radiance, in candela per square meter, of a full white pixel of an emissive imagery layer, as geo.map.layer.set_emission sets it. Absent, the sun and sky light the layer. Defaults to None.

black_point optional : float | None

The linear luminance at or below which a pixel of an emissive imagery layer gives off no light, as geo.map.layer.set_emission sets it. Absent for a layer that is not emissive. Defaults to None.

area optional : GeoBounds | None

The ground the layer covers, as its source declares it or else as its tile grid reaches. Absent until state is ready, and absent when the area covers three quarters or more of the body’s surface, which counts as the whole body. Also absent when the layer’s grid cannot be placed in longitude and latitude. Defaults to None.

transparent_color optional : TransparentColor | None

The color an imagery layer draws clear, as geo.map.layer.set_transparent_color sets it. Absent, the layer draws every color it holds. Defaults to None.

detect_placeholders : bool

Whether repeated nonuniform tiles can be classified as placeholders.

elevation_reference optional : ElevationReference | None

Defaults to None.

legend_url optional : str | None

The URL of the legend image a WMTS service publishes for the style the layer draws, as the service’s capabilities document writes it. Absent when the service publishes none, and for sources other than WMTS. Defaults to None.

LayerRole

Enum

class LayerRole(IntEnum)

What a layer gives the map.

Values: IMAGERY = 0 Colors drawn on the ground. Imagery layers draw from the bottom up. ELEVATION = 1 Heights the ground is raised to. The top elevation layer wins where it has data.

IMAGERY = 0

Colors drawn on the ground. Imagery layers draw from the bottom up.

ELEVATION = 1

Heights the ground is raised to. The top elevation layer wins where it has data.

LayerState

Enum

class LayerState(IntEnum)

Whether the map has read a layer’s source and can draw it.

Values: LOADING = 0 Source configuration has not finished. READY = 1 The source is configured. Individual tiles can still be missing or loading. FAILED = 2 The source could not be read or converted to the map’s elevation reference. The layer stays saved and is read again when the project is next loaded or the layer’s source or credentials change.

LOADING = 0

Source configuration has not finished.

READY = 1

The source is configured. Individual tiles can still be missing or loading.

FAILED = 2

The source could not be read or converted to the map’s elevation reference. The layer stays saved and is read again when the project is next loaded or the layer’s source or credentials change.

NotCovered

NotCovered()

The layer serves no tile at the place.

NotLoaded

NotLoaded()

The layer serves the place, but no tile over it has loaded at any level.

Resampling

Enum

class Resampling(IntEnum)

How an imagery layer’s pixels are read between their centers.

Values: BILINEAR = 0 Blends the four nearest pixels, for pictures and measured values. NEAREST = 1 Takes the nearest pixel, for class codes such as land cover, where a blend of two codes would be a third code that is in neither pixel.

BILINEAR = 0

Blends the four nearest pixels, for pictures and measured values.

NEAREST = 1

Takes the nearest pixel, for class codes such as land cover, where a blend of two codes would be a third code that is in neither pixel.

TileAuth

TileAuth(
    *,
    query: tuple[types.geo.map.layer.KeyValue, ...] = (),
    headers: tuple[types.geo.map.layer.KeyValue, ...] = ()
)

Credentials a layer sends with every request it makes.

Query pairs are appended to every request URL: the service document and every tile. Headers are sent on every request. A browser refuses some headers on a cross-origin request unless the service allows them, so a key is more likely to work as a query pair there. A layer’s credentials are saved with the project, values included.

query optional : tuple[KeyValue, ...]

Defaults to ().

headers optional : tuple[KeyValue, ...]

Defaults to ().

TimeSelection

TimeSelection()

Select dataset time independently of the viewport’s sunlight configuration.

Construct one of the nested classes. Use isinstance to check its type.

TimeSelection.FollowClock

TimeSelection.FollowClock(value: types.geo.map.layer.FollowClock)

TimeSelection.FollowClock

value : FollowClock

TimeSelection.Pinned

TimeSelection.Pinned(value: types.datetime.Timestamp)

TimeSelection.Pinned

value : Timestamp

TransparentColor

TransparentColor(*, color: types.color.ColorRgb, tolerance: int)

A color an imagery layer draws clear, for a service that fills the ground it has no data for with a solid color, as a JPEG service must.

color : ColorRgb

The color as the layer’s pixels write it, with 8-bit channels (0 to 255).

tolerance : int

How many 8-bit steps each channel of a pixel may lie from color for the pixel to draw clear.