geo.data
4 functions / 3 types
Index
| Function | Description |
|---|---|
| grids_needed | List the grids that the most precise conversion between two systems needs, and whether each is installed. Call it before adding a layer, and install the grids it lists first. |
| install_grid | Install a datum or geoid grid in the GeoTIFF form PROJ-data distributes, under its PROJ-data file name, such as ca_nrc_ntv2_0.tif. |
| install_registry_file | Install a registry file in the epsg.bin format, whose entries all belong to authority, such as the epsg.bin file shipped with this engine version under the authority EPSG. |
| status | Report the geospatial data the engine holds. |
| Type | Description |
|---|---|
| AreaOfInterest | An area in WGS 84 longitude and latitude degrees. west greater than east crosses the antimeridian. |
| DataStatus | The geospatial data the engine holds. |
| GridNeed | A grid that a conversion needs. |
grids_needed
def grids_needed(
*,
source: types.geo.CrsId,
target: types.geo.CrsId,
area_of_interest: types.geo.data.AreaOfInterest | None = None,
_transaction_id: str | None = None
) -> tuple[types.geo.data.GridNeed, ...]List the grids that the most precise conversion between two systems needs, and whether each is installed. Call it before adding a layer, and install the grids it lists first.
Without an area of interest, the most precise conversion can need a grid for a region the layer
does not cover. Fails with InvalidArgument when the registry does not hold a system.
Returns tuple[GridNeed, ...].
source : CrsId
target : CrsId
area_of_interest optional : AreaOfInterest | None
Defaults to None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
install_grid
def install_grid(
*,
name: str,
contents: bytes,
_transaction_id: str | None = None
) -> NoneInstall a datum or geoid grid in the GeoTIFF form PROJ-data distributes, under its PROJ-data
file name, such as ca_nrc_ntv2_0.tif.
Fails with InvalidArgument when the file is not a GeoTIFF grid, or when a different file is
already installed under the name. Installing the same file again does nothing.
Returns None.
name : str
contents : bytes
The whole file.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
install_registry_file
def install_registry_file(
*,
authority: str,
contents: bytes,
_transaction_id: str | None = None
) -> NoneInstall a registry file in the epsg.bin format, whose entries all belong to authority, such
as the epsg.bin file shipped with this engine version under the authority EPSG.
Fails with InvalidArgument for bytes that are not a well-formed registry file, and for a file
that defines an entry the registry already holds differently, and installs nothing then.
Installing the same file again does nothing.
Returns None.
authority : str
The authority every entry of the file belongs to, such as EPSG.
contents : bytes
The whole file.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
status
def status(*, _transaction_id: str | None = None) -> types.geo.data.DataStatusReport the geospatial data the engine holds.
Returns DataStatus.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
AreaOfInterest
AreaOfInterest(*, west: float, south: float, east: float, north: float)An area in WGS 84 longitude and latitude degrees. west greater than east crosses the
antimeridian.
west : float
south : float
east : float
north : float
DataStatus
DataStatus(
*,
registry_files: tuple[str, ...] = (),
registered: int,
grids: tuple[str, ...] = ()
)The geospatial data the engine holds.
registry_files optional : tuple[str, ...]
The authority of each installed registry file, such as EPSG, in the order installed. Defaults to ().
registered : int
The number of definitions registered with geo.crs.register.
grids optional : tuple[str, ...]
The names of the installed grids. Defaults to ().
GridNeed
GridNeed(*, name: str, installed: bool)A grid that a conversion needs.
name : str
The PROJ-data GeoTIFF file name, for install_grid.
installed : bool