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

locator

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

exception eoxserver.services.exceptions.NoSuchCoverageException(items)

Bases: eoxserver.services.exceptions.LocatorListException

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

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

Bases: eoxserver.services.exceptions.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'
locator
exception eoxserver.services.exceptions.RenderException(message, locator, is_parameter=True)

Bases: Exception

Rendering related exception.

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: eoxserver.services.exceptions.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

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

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

Bases: object

Abstract base class for render parameters

class eoxserver.services.parameters.VersionedParams(version)

Bases: object

version

eoxserver.services.result module

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

Bases: eoxserver.services.result.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.

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: eoxserver.services.result.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.

data

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

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.

content_type

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

data

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

data_file

Returns the data as a Python file-like object.

delete()

Cleanup any associated files, allocated memory, etc.

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

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