Package geoengine

Entry point for Geo Engine Python Library

Expand source code
'''Entry point for Geo Engine Python Library'''

from pkg_resources import get_distribution
from requests import utils
from pydantic import ValidationError

from geoengine_openapi_client.exceptions import BadRequestException, OpenApiException, ApiTypeError, ApiValueError, \
    ApiKeyError, ApiAttributeError, ApiException, NotFoundException
from .auth import Session, get_session, initialize, reset
from .colorizer import Colorizer, ColorBreakpoint, LinearGradientColorizer, PaletteColorizer, \
    LogarithmicGradientColorizer
from .datasets import upload_dataframe, StoredDataset, add_dataset, volumes, AddDatasetProperties, \
    delete_dataset, list_datasets, DatasetListOrder, OgrSourceDatasetTimeType, OgrOnError
from .error import GeoEngineException, InputException, UninitializedException, TypeException, \
    MethodNotCalledOnPlotException, MethodNotCalledOnRasterException, MethodNotCalledOnVectorException, \
    SpatialReferenceMismatchException, check_response_for_error, ModificationNotOnLayerDbException, \
    InvalidUrlException, MissingFieldInResponseException
from .layers import Layer, LayerCollection, LayerListing, LayerCollectionListing, \
    LayerId, LayerCollectionId, LayerProviderId, \
    layer_collection, layer
from .ml import register_ml_model, MlModelConfig
from .permissions import add_permission, remove_permission, add_role, remove_role, assign_role, revoke_role, \
    ADMIN_ROLE_ID, REGISTERED_USER_ROLE_ID, ANONYMOUS_USER_ROLE_ID, Permission, Resource, UserId, RoleId
from .tasks import Task, TaskId
from .types import QueryRectangle, GeoTransform, \
    RasterResultDescriptor, Provenance, UnitlessMeasurement, ContinuousMeasurement, \
    ClassificationMeasurement, BoundingBox2D, TimeInterval, SpatialResolution, SpatialPartition2D, \
    RasterSymbology, VectorSymbology, VectorDataType, VectorResultDescriptor, VectorColumnInfo, \
    FeatureDataType, RasterBandDescriptor, DEFAULT_ISO_TIME_FORMAT, RasterColorizer, SingleBandRasterColorizer, \
    MultiBandRasterColorizer

from .util import clamp_datetime_ms_ns
from .workflow import WorkflowId, Workflow, workflow_by_id, register_workflow, get_quota, update_quota
from .raster import RasterTile2D
from .raster_workflow_rio_writer import RasterWorkflowRioWriter

from . import workflow_builder


DEFAULT_USER_AGENT = f'geoengine-python/{get_distribution("geoengine").version}'


def default_user_agent(_name="python-requests"):
    return DEFAULT_USER_AGENT


utils.default_user_agent = default_user_agent

Sub-modules

geoengine.api

These types represent Geo Engine's backend API types before/after JSON (de)serialization.

geoengine.auth

Module for encapsulating Geo Engine authentication

geoengine.backports

This module contains backports of newer Python features …

geoengine.colorizer

This module is used to generate geoengine compatible color map definitions as a json string.

geoengine.datasets

Module for working with datasets and source definitions

geoengine.error

Package errors and backend mapped error types

geoengine.layers

A wrapper around the layer and layerDb API

geoengine.ml

Util functions for machine learning

geoengine.permissions

A wrapper for the GeoEngine permissions API.

geoengine.raster

Raster data types

geoengine.raster_workflow_rio_writer

A module that contains classes to write raster data from a Geo Engine raster workflow.

geoengine.tasks

Module for encapsulating Geo Engine tasks API

geoengine.types

Different type mappings of geo engine types

geoengine.util

Module for utility functions

geoengine.workflow

A workflow representation and methods on workflows

geoengine.workflow_builder

Entry point for workflow building blocks for the Geo Engine API

Functions

def default_user_agent()
Expand source code
def default_user_agent(_name="python-requests"):
    return DEFAULT_USER_AGENT