isogeo_pysdk.api.routes_service_layers module

Isogeo API v1 - API Routes for ServiceLayers entities

See: http://help.isogeo.com/api/complete/index.html

class isogeo_pysdk.api.routes_service_layers.ApiServiceLayer(api_client=None)[source]

Bases: object

Routes as methods of Isogeo API used to manipulate service_layers.

associate_metadata(service: isogeo_pysdk.models.metadata.Metadata, layer: isogeo_pysdk.models.service_layer.ServiceLayer, dataset: isogeo_pysdk.models.metadata.Metadata) → requests.models.Response[source]

Associate a service layer with a dataset metadata.

If the specified layer is already associated, the response is 409.

Parameters:
  • service (Metadata) – metadata of the service which contains the layer
  • layer (ServiceLayer) – layer model object to associate
  • dataset (Metadata) – metadata of the dataset to associate with
Example:
>>> # retrieve objects to be associated. First: the metadata of the service.
>>> service = isogeo.metadata.get(
        metadata_id=str,
    )
>>> # second: the layer of the service you want to associate
>>> layer = isogeo.metadata.layers.layer(
        metadata_id=service._id,
        layer_id=str,
    )
>>> # third: the dataset to be associated with the service layer
>>> dataset = isogeo.metadata.get(
        metadata_id=str,
    )
>>> # associate them
>>> isogeo.metadata.layers.associate_metadata(
        service=service,
        layer=layer,
        dataset=metadata
    )
create(metadata: isogeo_pysdk.models.metadata.Metadata, layer: isogeo_pysdk.models.service_layer.ServiceLayer) → isogeo_pysdk.models.service_layer.ServiceLayer[source]

Add a new layer to a metadata (= resource).

Parameters:
  • metadata (Metadata) – metadata (resource) to edit. Must be a service.
  • ServiceLayer (ServiceLayer) – service_layer object to create
delete(layer: isogeo_pysdk.models.service_layer.ServiceLayer, metadata: isogeo_pysdk.models.metadata.Metadata = None)[source]

Delete a service layer from Isogeo database.

Parameters:
  • layer (ServiceLayer) – ServiceLayer model object to delete
  • metadata (Metadata) – parent metadata (resource) containing the service_layer
dissociate_metadata(service: isogeo_pysdk.models.metadata.Metadata, layer: isogeo_pysdk.models.service_layer.ServiceLayer, dataset: isogeo_pysdk.models.metadata.Metadata) → requests.models.Response[source]

Removes the association between a a service layer with a dataset metadata.

If the association doesn’t exist, the response is 404.

Parameters:
  • service (Metadata) – metadata of the service which contains the layer
  • layer (ServiceLayer) – layer model object to associate
  • dataset (Metadata) – metadata of the dataset to associate with
layer(metadata_id: str, layer_id: str) → isogeo_pysdk.models.service_layer.ServiceLayer[source]

Get details about a specific service_layer.

Parameters:
  • metadata_id (str) – metadata with layers
  • layer_id (str) – service layer UUID
listing(metadata: isogeo_pysdk.models.metadata.Metadata) → list[source]

Get all service layers of a metadata.

Parameters:metadata (Metadata) – metadata (resource) to edit
update(layer: isogeo_pysdk.models.service_layer.ServiceLayer, metadata: isogeo_pysdk.models.metadata.Metadata = None) → isogeo_pysdk.models.service_layer.ServiceLayer[source]

Update a service layer.

Parameters:
  • layer (ServiceLayer) – ServiceLayer model object to update
  • metadata (Metadata) – parent metadata (resource) containing the service_layer