eoxserver.services package

Subpackages

Submodules

eoxserver.services.exceptions module

exception eoxserver.services.exceptions.HTTPMethodNotAllowedError(msg, allowed_methods)

Bases: Exception

This exception is raised in case of a HTTP requires with unsupported HTTP method. This exception should always lead to the 405 Method not allowed HTTP error.

The constructor takes two arguments, the error message mgs and the list of the accepted HTTP methods allowed_methods.

exception eoxserver.services.exceptions.InterpolationMethodNotSupportedException

Bases: Exception

This exception indicates a not supported interpolation method.

code = 'InterpolationMethodNotSupported'
locator = 'interpolation'
exception eoxserver.services.exceptions.InvalidAxisLabelException(axis_label)

Bases: Exception

This exception indicates that an invalid axis name was chosen in a WCS 2.0 subsetting parameter.

code = 'InvalidAxisLabel'
exception eoxserver.services.exceptions.InvalidFieldSequenceException(msg, locator)

Bases: Exception

Error in RangeSubsetting for illegal intervals.

code = 'InvalidFieldSequence'
exception eoxserver.services.exceptions.InvalidOutputCrsException

Bases: Exception

This exception indicates an invalid WCS 2.0 outputCrs parameter was submitted.

code = 'OutputCrs-NotSupported'
locator = 'outputCrs'
exception eoxserver.services.exceptions.InvalidRequestException(msg, code=None, locator=None)

Bases: Exception

This exception indicates that the request was invalid and an exception report shall be returned to the client.

The constructor takes three arguments, namely msg, the error message, code, the error code, and locator, which is needed in OWS exception reports for indicating which part of the request produced the error.

How exactly the exception reports are constructed is not defined by the exception, but by exception handlers.

exception eoxserver.services.exceptions.InvalidScaleExtentException(low, high)

Bases: Exception

Error in ScaleExtent operations

code = 'InvalidExtent'
exception eoxserver.services.exceptions.InvalidScaleFactorException(scalefactor)

Bases: Exception

Error in ScaleFactor and ScaleAxis operations

code = 'InvalidScaleFactor'
exception eoxserver.services.exceptions.InvalidSubsettingCrsException

Bases: Exception

This exception indicates an invalid WCS 2.0 subsettingCrs parameter was submitted.

code = 'SubsettingCrs-NotSupported'
locator = 'subsettingCrs'
exception eoxserver.services.exceptions.InvalidSubsettingException

Bases: Exception

This exception indicates an invalid WCS 2.0 subsetting parameter was submitted.

code = 'InvalidSubsetting'
locator = 'subset'
exception eoxserver.services.exceptions.LocatorListException(items)

Bases: Exception

Base class for exceptions that report that a number of items are missing or invalid

property locator

This property provides a list of all missing/invalid items.

exception eoxserver.services.exceptions.NoSuchCoverageException(items)

Bases: LocatorListException

This exception indicates that the requested coverage(s) do not exist.

code = 'NoSuchCoverage'
exception eoxserver.services.exceptions.NoSuchDatasetSeriesOrCoverageException(items)

Bases: LocatorListException

This exception indicates that the requested coverage(s) or dataset series do not exist.

code = 'NoSuchDatasetSeriesOrCoverage'
exception eoxserver.services.exceptions.NoSuchFieldException(msg, locator)

Bases: Exception

Error in RangeSubsetting when band does not exist.

code = 'NoSuchField'
exception eoxserver.services.exceptions.OperationNotSupportedException(message, operation=None)

Bases: Exception

Exception to be thrown when some operations are not supported or disabled.

code = 'OperationNotSupported'
property locator
exception eoxserver.services.exceptions.RenderException(message, locator, is_parameter=True)

Bases: Exception

Rendering related exception.

property code
exception eoxserver.services.exceptions.ScaleAxisUndefinedException(axis)

Bases: Exception

Error in all scaling operations involving an axis

code = 'ScaleAxisUndefined'
exception eoxserver.services.exceptions.ServiceNotSupportedException(service)

Bases: OperationNotSupportedException

Exception to be thrown when a specific OWS service is not enabled.

exception eoxserver.services.exceptions.VersionNegotiationException

Bases: Exception

This exception indicates that version negotiation fails. Such errors can happen with OWS 2.0 compliant “new-style” version negotation.

code = 'VersionNegotiationFailed'
exception eoxserver.services.exceptions.VersionNotSupportedException(service, version)

Bases: Exception

Exception to be thrown when a specific OWS service version is not supported.

code = 'InvalidParameterValue'

eoxserver.services.models module

class eoxserver.services.models.ServiceVisibility(id, eo_object, service, visibility)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

SERVICE_CHOICES = [('wms', 'WMS'), ('wcs', 'WCS'), ('os', 'OpenSearch'), ('wc', 'WebClient')]
eo_object

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

eo_object_id
get_service_display(*, field=<django.db.models.fields.CharField: service>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
service

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

visibility

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

eoxserver.services.parameters module

class eoxserver.services.parameters.CapabilitiesRenderParams(coverages, version, sections=None, accept_languages=None, accept_formats=None, updatesequence=None, request=None)

Bases: object

property accept_formats
property accept_languages
property coverages
property request
property sections
property updatesequence
property version
class eoxserver.services.parameters.RenderParameters

Bases: object

Abstract base class for render parameters

class eoxserver.services.parameters.VersionedParams(version)

Bases: object

property version

eoxserver.services.result module

class eoxserver.services.result.ResultBuffer(buf, content_type=None, filename=None, identifier=None)

Bases: ResultItem

Class for results that are actually a subset of a larger context. Usually a buffer.

chunked(chunksize)

Returns a chunk of the data, which has at most chunksize bytes.

property data

Returns the “raw” data, usually as a string, buffer, memoryview, etc.

class eoxserver.services.result.ResultFile(path, content_type=None, filename=None, identifier=None)

Bases: ResultItem

Class for results that wrap physical files on the disc.

chunked(chunksize)

Returns a chunk of the data, which has at most chunksize bytes.

property data

Returns the “raw” data, usually as a string, buffer, memoryview, etc.

property data_file

Returns the data as a Python file-like object.

delete()

Cleanup any associated files, allocated memory, etc.

class eoxserver.services.result.ResultItem(content_type=None, filename=None, identifier=None)

Bases: object

Base class (or interface) for result items of a result set.

Parameters:
  • content_type – the content type of the result item. in HTTP this will be translated to the Content-Type header

  • filename – the filename of the result item.

  • identifier – the identifier of the result item. translated to Content-Id HTTP header

chunked(chunksize)

Returns a chunk of the data, which has at most chunksize bytes.

property content_type

Reterns a binary value of content-type if it is a string.

property data

Returns the “raw” data, usually as a string, buffer, memoryview, etc.

property data_file

Returns the data as a Python file-like object.

delete()

Cleanup any associated files, allocated memory, etc.

property size
eoxserver.services.result.get_content_type(result_set)

Returns the content type of a result set. If only one item is included its content type is used, otherwise the constant “multipart/related”.

eoxserver.services.result.get_headers(result_item)

Yields content headers, if they are set in the result item.

eoxserver.services.result.get_payload_size(result_set, boundary)

Calculate the size of the result set and all entailed result items plus headers.

eoxserver.services.result.parse_headers(headers)

Convenience function to read the “Content-Type”, “Content-Disposition” and “Content-Id” headers.

Parameters:

headers – the raw header dict

eoxserver.services.result.result_set_from_raw_data(data)

Create a result set from raw HTTP data. This can either be a single or a multipart string. It returns a list containing objects of the ResultBuffer type that reference substrings of the given data.

Parameters:

data – the raw byte data

Returns:

a result set: a list containing ResultBuffer

eoxserver.services.result.to_http_response(result_set, response_type=<class 'django.http.response.HttpResponse'>, boundary=None)

Returns a response for a given result set. The response_type is the class to be used. It must be capable to work with iterators. This function is also responsible to delete any temporary files and buffers of the result_set.

Parameters:
  • result_set – an iterable of objects following the ResultItem interface

  • response_type – the response type class to use; defaults to HttpResponse. For streaming responses use StreamingHttpResponse

  • boundary – the multipart boundary; if omitted a UUID hex string is computed and used

Returns:

a response object of the desired type

eoxserver.services.subset module

class eoxserver.services.subset.Slice(axis, value)

Bases: Subset

Slice subsets reduce the dimension of the subsetted object by one and slice the given axis at the specified value.

Parameters:
  • axis – the axis name

  • value – the slice point

class eoxserver.services.subset.Subsets(iterable, crs=None, allowed_types=None)

Bases: list

Convenience class to handle a variety of spatial and/or temporal subsets.

Parameters:
  • iterable – an iterable of objects inheriting from Trim or Slice

  • crs – the CRS definition

  • allowed_types – the allowed subset types. defaults to both Trim and Slice

append(subset)

See list.append()

bounding_polygon(coverage)

Returns a minimum bounding django.contrib.gis.geos.Polygon for the given Coverage

Parameters:

coverage – the coverage to calculate the bounding polygon for

Returns:

the calculated Polygon

property crs

Return the subset CRS definiton.

extend(iterable)

See list.extend()

filter(queryset, containment='overlaps')

Filter a Django QuerySet of objects inheriting from EOObject.

Parameters:
  • queryset – the QuerySet to filter

  • containment – either “overlaps” or “contains”

Returns:

a QuerySet with additional filters applied

get_filters(containment='overlaps')

Filter a Django QuerySet of objects inheriting from EOObject.

Parameters:
  • queryset – the QuerySet to filter

  • containment – either “overlaps” or “contains”

Returns:

a dict with the filters

property has_t

Check if a subset along the temporal axis is given.

property has_x

Check if a subset along the X-axis is given.

property has_y

Check if a subset along the Y-axis is given.

insert(i, subset)

See list.insert()

matches(eo_object, containment='overlaps')

Check if the given EOObject matches the given subsets.

Parameters:
  • eo_object – the EOObject to match

  • containment – either “overlaps” or “contains”

Returns:

a boolean value indicating if the object is contained in the given subsets

property srid

Tries to find the correct integer SRID for the crs.

property xy_bbox

Returns the minimum bounding box for all X and Y subsets.

Returns:

a list of four elements [minx, miny, maxx, maxy], which might be None

class eoxserver.services.subset.Trim(axis, low=None, high=None)

Bases: Subset

Trim subsets reduce the domain of the specified axis

Parameters:
  • axis – the axis name

  • low – the lower end of the Trim; if omitted, the Trim has no lower bound

  • high – the upper end of the Trim; if omitted, the Trim has no upper bound

eoxserver.services.urls module

eoxserver.services.urls.get_http_service_url(request=None)

Returns the URL the OWS view is available under. If a django.http.HttpRequest is passed, an absolute URL is constructed with the request information.

eoxserver.services.views module

This model contains Django views for the EOxServer software. Its main function is ows() which handles all incoming OWS requests

eoxserver.services.views.ows(request)

Main entry point for OWS requests against EOxServer. It uses the ServiceComponent to dynamically determine the handler component for this request.

If an exception occurs during the handling of the request, an exception handler component is determined and dispatched.

Any response of the service handler and exception handler is transformed to a django HttpResponse to adhere the required interface.

Module contents