Skip to content

geo.geoid

3 functions / 3 types

Index

FunctionDescription
add_modelRegister an immutable geoid grid from a GeoTIFF file. Maps retain it independently after the registration is released. A grid whose columns span 360 degrees wraps in longitude.
get_modelReturn metadata for a registered model or a model retained by a map or pending operation.
release_modelRelease registration ownership. Existing maps and pending operations keep the model alive. The grid is freed when the last owner releases it; later use of an expired ID fails.
TypeDescription
GeoidFileA geoid grid file, unchanged from how it is distributed.
GeoidFileFormatThe format of a geoid grid file.
ModelInfoModelInfo

add_model

def add_model(
    *,
    vertical_crs: types.geo.VerticalCrsId | None = None,
    file: types.geo.geoid.GeoidFile,
    _transaction_id: str | None = None
) -> types.geo.GeoidModelId

Register an immutable geoid grid from a GeoTIFF file. Maps retain it independently after the registration is released. A grid whose columns span 360 degrees wraps in longitude.

Fails with InvalidArgument when the file is not a GeoTIFF geoid grid. A grid in another format, such as GTX, is converted to GeoTIFF first, as PROJ-data’s grid_tools scripts do.

Returns GeoidModelId.

vertical_crs optional : VerticalCrsId | None

Defaults to None.

file : GeoidFile

_transaction_id optional : str | None

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

get_model

def get_model(
    *,
    model: types.geo.GeoidModelId,
    _transaction_id: str | None = None
) -> types.geo.geoid.ModelInfo

Return metadata for a registered model or a model retained by a map or pending operation.

Returns ModelInfo.

model : GeoidModelId

_transaction_id optional : str | None

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

release_model

def release_model(
    *,
    model: types.geo.GeoidModelId,
    _transaction_id: str | None = None
) -> None

Release registration ownership. Existing maps and pending operations keep the model alive. The grid is freed when the last owner releases it; later use of an expired ID fails.

Returns None.

model : GeoidModelId

_transaction_id optional : str | None

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

GeoidFile

GeoidFile(
    *,
    identifier: str,
    format: types.geo.geoid.GeoidFileFormat,
    contents: bytes
)

A geoid grid file, unchanged from how it is distributed.

identifier : str

The name get_model reports for the model.

contents : bytes

The whole file.

GeoidFileFormat

Enum

class GeoidFileFormat(IntEnum)

The format of a geoid grid file.

Values: GEO_TIFF = 0 GeoTIFF, as PROJ-data distributes its grids, such as us_nga_egm96_15.tif: one band of 32 or 64 bit floating-point heights in meters on a longitude and latitude grid. Only the first image is read.

GEO_TIFF = 0

GeoTIFF, as PROJ-data distributes its grids, such as us_nga_egm96_15.tif: one band of 32 or 64 bit floating-point heights in meters on a longitude and latitude grid. Only the first image is read.

ModelInfo

ModelInfo(
    *,
    id: types.geo.GeoidModelId,
    name: str,
    vertical_crs: types.geo.VerticalCrsId | None = None
)

ModelInfo

name : str

vertical_crs optional : VerticalCrsId | None

Defaults to None.