Skip to content

datasets

Module for working with datasets and source definitions

class UnixTimeStampType(Enum)

A unix time stamp type

class OgrSourceTimeFormat()

Base class for OGR time formats

@dataclass
class UnixTimeStampOgrSourceTimeFormat(OgrSourceTimeFormat)

An OGR time format specified in seconds (UNIX time)

@dataclass
class AutoOgrSourceTimeFormat(OgrSourceTimeFormat)

An auto detection OGR time format

@dataclass
class CustomOgrSourceTimeFormat(OgrSourceTimeFormat)

A custom OGR time format

class OgrSourceDuration()

Base class for the duration part of a OGR time format

@classmethod
def value(
cls,
value: int,
granularity: TimeStepGranularity = TimeStepGranularity.SECONDS
) -> ValueOgrSourceDurationSpec

Returns the value of the duration

class ValueOgrSourceDurationSpec(OgrSourceDuration)

A fixed value for a source duration

class ZeroOgrSourceDurationSpec(OgrSourceDuration)

An instant, i.e. no duration

class InfiniteOgrSourceDurationSpec(OgrSourceDuration)

An open-ended time duration

class OgrSourceDatasetTimeType()

A time type specification for OGR dataset definitions

@classmethod
def start(cls, start_field: str, start_format: OgrSourceTimeFormat,
duration: OgrSourceDuration) -> StartOgrSourceDatasetTimeType

Specify a start column and a fixed duration

@classmethod
def start_end(
cls, start_field: str, start_format: OgrSourceTimeFormat,
end_field: str,
end_format: OgrSourceTimeFormat) -> StartEndOgrSourceDatasetTimeType

The dataset contains start and end column

@classmethod
def start_duration(
cls, start_field: str, start_format: OgrSourceTimeFormat,
duration_field: str) -> StartDurationOgrSourceDatasetTimeType

The dataset contains start and a duration column

@dataclass
class NoneOgrSourceDatasetTimeType(OgrSourceDatasetTimeType)

Specify no time information

@dataclass
class StartOgrSourceDatasetTimeType(OgrSourceDatasetTimeType)

Specify a start column and a fixed duration

@dataclass
class StartEndOgrSourceDatasetTimeType(OgrSourceDatasetTimeType)

The dataset contains start and end column

StartDurationOgrSourceDatasetTimeType Objects

Section titled “StartDurationOgrSourceDatasetTimeType Objects”
@dataclass
class StartDurationOgrSourceDatasetTimeType(OgrSourceDatasetTimeType)

The dataset contains start and a duration column

class OgrOnError(Enum)

How to handle errors when loading an OGR dataset

class AddDatasetProperties()

The properties for adding a dataset

TODO: add vector symbology if needed

def __init__(display_name: str,
description: str,
source_operator: Literal["GdalSource",
"OgrSource"] = "GdalSource",
symbology: RasterSymbology | None = None,
provenance: list[Provenance] | None = None,
name: str | None = None)

Creates a new AddDatasetProperties object

def to_api_dict() -> geoengine_api_client.AddDataset

Converts the properties to a dictionary

class VolumeId()

A wrapper for an volume id

def __eq__(other) -> bool

Checks if two volume ids are equal

def pandas_dtype_to_column_type(dtype: np.dtype) -> FeatureDataType

Convert a pandas dtype to a column type

def upload_dataframe(df: gpd.GeoDataFrame,
display_name: str = "Upload from Python",
name: str | None = None,
time: OgrSourceDatasetTimeType | None = None,
on_error: OgrOnError = OgrOnError.ABORT,
timeout: int = 3600) -> DatasetName

Uploads a given dataframe to Geo Engine.

df The dataframe to upload. display_name The display name of the dataset. Defaults to “Upload from Python”. name The name the dataset should have. If not given, a random name (UUID) will be generated. time A time configuration for the dataset. Defaults to OgrSourceDatasetTimeType.none(). on_error The error handling strategy. Defaults to OgrOnError.ABORT. timeout The upload timeout in seconds. Defaults to 3600.

DatasetName The name of the uploaded dataset

GeoEngineException If the dataset could not be uploaded or the name is already taken.

class StoredDataset(NamedTuple)

The result of a store dataset request is a combination of upload_id and dataset_name

@classmethod
def from_response(cls, response: api.StoredDataset) -> StoredDataset

Parse a http response to an StoredDataset

@dataclass
class Volume()

A volume

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

Parse a http response to an Volume

def volumes(timeout: int = 60) -> list[Volume]

Returns a list of all volumes

def volume_by_name(volume_name: str, timeout: int = 60) -> Volume | None

Returns a volume with the specified name or None if none exists

def add_dataset(data_store: Volume | UploadId,
properties: AddDatasetProperties,
meta_data: geoengine_api_client.MetaDataDefinition,
timeout: int = 60) -> DatasetName

Adds a dataset to the Geo Engine

def add_or_replace_dataset_with_permissions(
data_store: Volume | UploadId,
properties: AddDatasetProperties,
meta_data: geoengine_api_client.MetaDataDefinition,
permission_tuples: list[tuple[RoleId, Permission]] | None = None,
replace_existing=False,
timeout: int = 60) -> DatasetName

Add a dataset to the Geo Engine and set permissions. Replaces existing datasets if forced!

def delete_dataset(dataset_name: DatasetName, timeout: int = 60) -> None

Delete a dataset. The dataset must be owned by the caller.

def list_datasets_page(
offset: int = 0,
limit: int = 20,
order: DatasetListOrder = DatasetListOrder.NAME_ASC,
name_filter: str | None = None,
timeout: int = 60) -> list[geoengine_api_client.DatasetListing]

List datasets

def list_datasets(
offset: int = 0,
limit: int = 200,
order: DatasetListOrder = DatasetListOrder.NAME_ASC,
name_filter: str | None = None,
timeout: int = 60) -> Iterator[geoengine_api_client.DatasetListing]

List datasets

def dataset_info_by_name(
dataset_name: DatasetName | str,
timeout: int = 60) -> geoengine_api_client.models.Dataset | None

Get dataset information.

def dataset_metadata_by_name(
dataset_name: DatasetName | str,
timeout: int = 60
) -> geoengine_api_client.models.MetaDataDefinition | None

Get dataset information.