Skip to content

types

Different type mappings of geo engine types

class SpatialBounds()

A spatial bounds object

def __init__(xmin: float, ymin: float, xmax: float, ymax: float) -> None

Initialize a new SpatialBounds object

def as_bbox_str(y_axis_first=False) -> str

A comma-separated string representation of the spatial bounds with OGC axis ordering

def as_bbox_tuple(y_axis_first=False) -> tuple[float, float, float, float]

Return the bbox with OGC axis ordering of the srs

def x_axis_size() -> float

The size of the x axis

def y_axis_size() -> float

The size of the y axis

class BoundingBox2D(SpatialBounds)

‘A 2D bounding box.

@staticmethod
def from_response(
response: geoengine_api_client.BoundingBox2D) -> BoundingBox2D

create a BoundingBox2D from an API response

class SpatialPartition2D(SpatialBounds)

A 2D spatial partition.

@staticmethod
def from_response(
response: geoengine_api_client.SpatialPartition2D
) -> SpatialPartition2D

create a SpatialPartition2D from an API response

def to_bounding_box() -> BoundingBox2D

convert to a BoundingBox2D

@staticmethod
def from_bounding_box(bbox: BoundingBox2D) -> SpatialPartition2D

Creates a SpatialPartition2D from a BoundingBox2D

class TimeInterval()

‘A time interval.

def __init__(start: datetime | np.datetime64,
end: datetime | np.datetime64 | None = None) -> None

Initialize a new TimeInterval object

@property
def time_str() -> str

Return the time instance or interval as a string representation

@staticmethod
def from_response(
response: geoengine_api_client.models.TimeInterval) -> TimeInterval

create a TimeInterval from an API response

def to_api_dict() -> geoengine_api_client.TimeInterval

create a openapi TimeInterval from self

def __eq__(other: Any) -> bool

Check if two TimeInterval objects are equal.

class SpatialResolutionDict(TypedDict)

A spatial resolution as a dictionary

class SpatialResolution()

‘A spatial resolution.

def __init__(x_resolution: float, y_resolution: float) -> None

Initialize a new SpatialResolution object

@staticmethod
def from_response(response: SpatialResolutionDict) -> SpatialResolution

create a SpatialResolution from an API response

def resolution_ogc(srs_code: str) -> tuple[float, float]

Return the resolution in OGC style

class QueryRectangle()

A multi-dimensional query rectangle, consisting of spatial and temporal information.

def __init__(spatial_bounds: BoundingBox2D | SpatialPartition2D
| tuple[float, float, float, float],
time_interval: TimeInterval | tuple[datetime, datetime | None],
srs="EPSG:4326") -> None

Initialize a new QueryRectangle object

spatial_bounds The spatial bounds of the query rectangle. Either a BoundingBox2D or a tuple of floats (xmin, ymin, xmax, ymax) time_interval The time interval of the query rectangle. Either a TimeInterval or a tuple of datetime.datetime objects (start, end)

@property
def bbox_str() -> str

A comma-separated string representation of the spatial bounds

@property
def bbox_ogc_str() -> str

A comma-separated string representation of the spatial bounds with OGC axis ordering

@property
def bbox_ogc() -> tuple[float, float, float, float]

Return the bbox with OGC axis ordering of the srs

@property
def time() -> TimeInterval

Return the time instance or interval

@property
def spatial_bounds() -> BoundingBox2D

Return the spatial bounds

@property
def time_str() -> str

Return the time instance or interval as a string representation

@property
def srs() -> str

Return the SRS string

def __repr__() -> str

Return a string representation of the query rectangle.

def with_raster_bands(raster_bands: list[int]) -> RasterQueryRectangle

Converts a QueryRectangle into a RasterQueryRectangle

class RasterQueryRectangle(QueryRectangle)

A multi-dimensional query rectangle, consisting of spatial and temporal information and raster bands.

def __init__(spatial_bounds: BoundingBox2D | SpatialPartition2D
| tuple[float, float, float, float],
time_interval: TimeInterval | tuple[datetime, datetime | None],
raster_bands: list[int] | None | int,
srs="EPSG:4326") -> None

Initialize a new QueryRectangle object

spatial_bounds The spatial bounds of the query rectangle. Either a BoundingBox2D or a tuple of floats (xmin, ymin, xmax, ymax) time_interval The time interval of the query rectangle. Either a TimeInterval or a tuple of datetime.datetime objects (start, end) bands The raster bands of the query rectangle. A List of ints representing the band numbers.

@property
def raster_bands() -> list[int]

Return the query bands

def __repr__() -> str

Return a string representation of the query rectangle.

class ResultDescriptor()

Base class for result descriptors

def __init__(spatial_reference: str,
time_bounds: TimeInterval | None = None) -> None

Initialize a new ResultDescriptor object

@staticmethod
def from_response(
response: geoengine_api_client.TypedResultDescriptor
) -> ResultDescriptor

Parse a result descriptor from an http response

@classmethod
def is_raster_result(cls) -> bool

Return true if the result is of type raster

@classmethod
def is_vector_result(cls) -> bool

Return true if the result is of type vector

@classmethod
def is_plot_result(cls) -> bool

Return true if the result is of type plot

@property
def spatial_reference() -> str

Return the spatial reference

@property
def time_bounds() -> TimeInterval | None

Return the time bounds

class VectorResultDescriptor(ResultDescriptor)

A vector result descriptor

def __init__(spatial_reference: str,
data_type: VectorDataType,
columns: dict[str, VectorColumnInfo],
time_bounds: TimeInterval | None = None,
spatial_bounds: BoundingBox2D | None = None) -> None

Initialize a vector result descriptor

@staticmethod
def from_response_vector(
response: geoengine_api_client.TypedVectorResultDescriptor
) -> VectorResultDescriptor

Parse a vector result descriptor from an http response

@property
def data_type() -> VectorDataType

Return the data type

@property
def spatial_reference() -> str

Return the spatial reference

@property
def columns() -> dict[str, VectorColumnInfo]

Return the columns

@property
def spatial_bounds() -> BoundingBox2D | None

Return the spatial bounds

def __repr__() -> str

Display representation of the vector result descriptor

def to_api_dict() -> geoengine_api_client.TypedResultDescriptor

Convert the vector result descriptor to a dictionary

class FeatureDataType(str, Enum)

Vector column data type

@staticmethod
def from_string(data_type: str) -> FeatureDataType

Create a new VectorColumnDataType from a string

def to_api_enum() -> geoengine_api_client.FeatureDataType

Convert to an API enum

@dataclass
class VectorColumnInfo()

Vector column information

@staticmethod
def from_response(
response: geoengine_api_client.VectorColumnInfo) -> VectorColumnInfo

Create a new VectorColumnInfo from a JSON response

def to_api_dict() -> geoengine_api_client.VectorColumnInfo

Convert to a dictionary

@dataclass(repr=False)
class RasterBandDescriptor()

A raster band descriptor

@classmethod
def from_response(
cls, response: geoengine_api_client.RasterBandDescriptor
) -> RasterBandDescriptor

Parse an http response to a RasterBandDescriptor object

def __repr__() -> str

Display representation of a raster band descriptor

@dataclass
class GridIdx2D()

A grid index

@classmethod
def from_response(cls, response: geoengine_api_client.GridIdx2D) -> GridIdx2D

Parse an http response to a GridIdx2D object

@dataclass
class GridBoundingBox2D()

A grid boundingbox where lower right is inclusive index

@classmethod
def from_response(
cls,
response: geoengine_api_client.GridBoundingBox2D) -> GridBoundingBox2D

Parse an http response to a GridBoundingBox2D object

def contains_idx(idx: GridIdx2D) -> bool

Test if a GridIdx2D is contained by this

@dataclass
class SpatialGridDefinition()

A grid boundingbox where lower right is inclusive index

@classmethod
def from_response(
cls, response: geoengine_api_client.SpatialGridDefinition
) -> SpatialGridDefinition

Parse an http response to a SpatialGridDefinition object

def __repr__() -> str

Display representation of the SpatialGridDefinition

@dataclass
class SpatialGridDescriptor()

A grid boundingbox where lower right is inclusive index

@classmethod
def from_response(
cls, response: geoengine_api_client.SpatialGridDescriptor
) -> SpatialGridDescriptor

Parse an http response to a SpatialGridDefinition object

def __repr__() -> str

Display representation of the SpatialGridDescriptor

class RasterDataType(str, Enum)

Raster data type enum

@staticmethod
def from_string(data_type: str) -> RasterDataType

Create a new RasterDataType from a string

@staticmethod
def from_literal(
data_type: Literal["U8", "U16", "U32", "U64", "I8", "I16", "I32", "I64",
"F32", "F64"]
) -> RasterDataType

Create a new RasterDataType from a literal

def to_literal() -> Literal["U8", "U16", "U32", "U64", "I8", "I16", "I32",
"I64", "F32", "F64"]

Convert to a literal

@staticmethod
def from_api_enum(
data_type: geoengine_api_client.RasterDataType) -> RasterDataType

Create a new RasterDataType from an API enum

def to_api_enum() -> geoengine_api_client.RasterDataType

Convert to an API enum

def to_np_dtype() -> np.dtype

Convert to a numpy dtype

class TimeDimension()

A time dimension

@classmethod
def from_response(
cls, response: geoengine_api_client.TimeDimension
) -> RegularTimeDimension | IrregularTimeDimension

Parse a time dimension from an http response

class RegularTimeDimension(TimeDimension)

A regular time dimension

def __init__(step: TimeStep, origin: np.datetime64 | None = None) -> None

Initialize a new RegularTimeDimension

def to_api_dict() -> geoengine_api_client.TimeDimension

Convert the regular time dimension to a dictionary

@classmethod
def from_response(
cls,
response: geoengine_api_client.TimeDimension) -> RegularTimeDimension

Parse a regular time dimension from an http response

class IrregularTimeDimension(TimeDimension)

The irregular time dimension

def to_api_dict() -> geoengine_api_client.TimeDimension

Convert the irregular time dimension to a dictionary

@classmethod
def from_response(cls, response: Any) -> IrregularTimeDimension

Parse an irregular time dimension from an http response

class TimeDescriptor()

A time descriptor

def __init__(dimension: TimeDimension,
bounds: TimeInterval | None = None) -> None

Initialize a new TimeDescriptor

def to_api_dict() -> geoengine_api_client.TimeDescriptor

Convert the time descriptor to a dictionary

@staticmethod
def from_response(
response: geoengine_api_client.TimeDescriptor) -> TimeDescriptor

Parse a time descriptor from an http response

class RasterResultDescriptor(ResultDescriptor)

A raster result descriptor

def __init__(
data_type: RasterDataType | Literal["U8", "U16", "U32", "U64", "I8",
"I16", "I32", "I64", "F32", "F64"],
bands: list[RasterBandDescriptor],
spatial_reference: str,
spatial_grid: SpatialGridDescriptor,
time: TimeDescriptor | TimeInterval | TimeDimension | None = None
) -> None

Initialize a new RasterResultDescriptor

def to_api_dict() -> geoengine_api_client.TypedResultDescriptor

Convert the raster result descriptor to a dictionary

@staticmethod
def from_response_raster(
response: geoengine_api_client.TypedRasterResultDescriptor
) -> RasterResultDescriptor

Parse a raster result descriptor from an http response

@property
def spatial_reference() -> str

Return the spatial reference

def __repr__() -> str

Display representation of the raster result descriptor

class PlotResultDescriptor(ResultDescriptor)

A plot result descriptor

def __init__(spatial_reference: str,
time_bounds: TimeInterval | None = None,
spatial_bounds: BoundingBox2D | None = None) -> None

Initialize a new PlotResultDescriptor

def __repr__() -> str

Display representation of the plot result descriptor

@staticmethod
def from_response_plot(
response: geoengine_api_client.TypedPlotResultDescriptor
) -> PlotResultDescriptor

Create a new PlotResultDescriptor from a JSON response

@property
def spatial_reference() -> str

Return the spatial reference

def to_api_dict() -> geoengine_api_client.TypedResultDescriptor

Convert the plot result descriptor to a dictionary

class VectorDataType(str, Enum)

An enum of vector data types

@classmethod
def from_geopandas_type_name(cls, name: str) -> VectorDataType

Resolve vector data type from geopandas geometry type

@staticmethod
def from_literal(
literal: Literal["Data", "MultiPoint", "MultiLineString", "MultiPolygon"]
) -> VectorDataType

Resolve vector data type from literal

@staticmethod
def from_api_enum(
data_type: geoengine_api_client.VectorDataType) -> VectorDataType

Resolve vector data type from API enum

@staticmethod
def from_string(string: str) -> VectorDataType

Resolve vector data type from string

class TimeStepGranularity(Enum)

An enum of time step granularities

@dataclass
class TimeStep()

A time step that consists of a granularity and a step size

def __init__(step: int, granularity: TimeStepGranularity | str) -> None

Initialize a new TimeStep object

@classmethod
def from_response(cls, response: geoengine_api_client.TimeStep) -> TimeStep

Parse an http response to a TimeStep object

@dataclass
class Provenance()

Provenance information as triplet of citation, license and uri

@classmethod
def from_response(cls,
response: geoengine_api_client.Provenance) -> Provenance

Parse an http response to a Provenance object

@dataclass
class ProvenanceEntry()

Provenance of a dataset

@classmethod
def from_response(
cls,
response: geoengine_api_client.ProvenanceEntry) -> ProvenanceEntry

Parse an http response to a ProvenanceEntry object

class Symbology()

Base class for symbology

@staticmethod
def from_response(response: geoengine_api_client.Symbology) -> Symbology

Parse an http response to a Symbology object

class VectorSymbology(Symbology)

A vector symbology

class RasterColorizer()

Base class for raster colorizer

@classmethod
def from_response(
cls,
response: geoengine_api_client.RasterColorizer) -> RasterColorizer

Parse an http response to a RasterColorizer object

@dataclass
class SingleBandRasterColorizer(RasterColorizer)

A raster colorizer for a specified band

@dataclass
class MultiBandRasterColorizer(RasterColorizer)

A raster colorizer for multiple bands

class RasterSymbology(Symbology)

A raster symbology

def __init__(raster_colorizer: RasterColorizer, opacity: float = 1.0) -> None

Initialize a new RasterSymbology

def to_api_dict() -> geoengine_api_client.Symbology

Convert the raster symbology to a dictionary

@staticmethod
def from_response_raster(
response: geoengine_api_client.RasterSymbology) -> RasterSymbology

Parse an http response to a RasterSymbology object

def __eq__(value)

Check if two RasterSymbologies are equal

class DataId()

Base class for data ids

@classmethod
def from_response(cls, response: geoengine_api_client.DataId) -> DataId

Parse an http response to a DataId object

class InternalDataId(DataId)

An internal data id

@classmethod
def from_response_internal(
cls, response: geoengine_api_client.InternalDataId) -> InternalDataId

Parse an http response to a InternalDataId object

def __repr__() -> str

Display representation of an internal data id

def __eq__(other) -> bool

Check if two internal data ids are equal

class ExternalDataId(DataId)

An external data id

@classmethod
def from_response_external(
cls, response: geoengine_api_client.ExternalDataId) -> ExternalDataId

Parse an http response to a ExternalDataId object

def __repr__() -> str

Display representation of an external data id

def __eq__(other) -> bool

Check if two external data ids are equal

class Measurement()

Base class for measurements

@staticmethod
def from_response(response: geoengine_api_client.Measurement) -> Measurement

Parse a result descriptor from an http response

class UnitlessMeasurement(Measurement)

A measurement that is unitless

def __str__() -> str

String representation of a unitless measurement

def __repr__() -> str

Display representation of a unitless measurement

class ContinuousMeasurement(Measurement)

A measurement that is continuous

def __init__(measurement: str, unit: str | None) -> None

Initialize a new ContiuousMeasurement

@staticmethod
def from_response_continuous(
response: geoengine_api_client.ContinuousMeasurement
) -> ContinuousMeasurement

Initialize a new `ContiuousMeasurement from a JSON response

def __str__() -> str

String representation of a continuous measurement

def __repr__() -> str

Display representation of a continuous measurement

class ClassificationMeasurement(Measurement)

A measurement that is a classification

def __init__(measurement: str, classes: dict[int, str]) -> None

Initialize a new ClassificationMeasurement

@staticmethod
def from_response_classification(
response: geoengine_api_client.ClassificationMeasurement
) -> ClassificationMeasurement

Initialize a new `ClassificationMeasurement from a JSON response

def __str__() -> str

String representation of a classification measurement

def __repr__() -> str

Display representation of a classification measurement

class GeoTransform()

The GeoTransform specifies the relationship between pixel coordinates and geographic coordinates.

In Geo Engine, x_pixel_size is always positive.

In Geo Engine, y_pixel_size is always negative.

def __init__(x_min: float, y_max: float, x_pixel_size: float,
y_pixel_size: float)

Initialize a new GeoTransform

@classmethod
def from_response(cls,
response: geoengine_api_client.GeoTransform) -> GeoTransform

Parse a geotransform from an HTTP JSON response

def to_gdal() -> tuple[float, float, float, float, float, float]

Convert to a GDAL geotransform

def coord_to_pixel_ul(x_cord: float, y_coord: float) -> GridIdx2D

Convert a coordinate to a pixel index rould towards top left

def coord_to_pixel_lr(x_cord: float, y_coord: float) -> GridIdx2D

Convert a coordinate to a pixel index ound towards lower right

def pixel_ul_to_coord(x_pixel: int, y_pixel: int) -> tuple[float, float]

Convert a pixel position into a coordinate

def spatial_to_grid_bounds(
bounds: SpatialPartition2D | BoundingBox2D) -> GridBoundingBox2D

Converts a BoundingBox2D or a SpatialPartition2D into a GridBoundingBox2D

def grid_bounds_to_spatial_bounds(
bounds: GridBoundingBox2D) -> SpatialPartition2D

Converts a GridBoundingBox2D into a SpatialPartition2D

def __eq__(other) -> bool

Check if two geotransforms are equal