Module eoxserver.resources.coverages.wrappers

This module provides implementations of coverage interfaces as defined in eoxserver.resources.coverages.interfaces. These classes wrap the resources stored in the database and augment them with additional application logic.

class eoxserver.resources.coverages.wrappers.CoverageWrapper

This is the base class for all coverage wrappers. It is a partial implementation of CoverageInterface. It inherits from ResourceWrapper.

getCoverageId()

Returns the Coverage ID.

getCoverageSubtype()

This method shall return the coverage subtype as defined in the WCS 2.0 EO-AP (EO-WCS). It must be overridden by concrete coverage wrappers. By default this method raises InternalError.

See the definition of getCoverageSubtype() in CoverageInterface for possible return values.

getData()

Returns the a CoverageDataWrapper object that wraps the coverage data, raises InternalError by default.

getDataStructureType()

Returns the data structure type of the coverage. To be implemented by subclasses, raises InternalError by default.

getLayerMetadata()

Returns a list of (metadata_key, metadata_value) pairs that represent MapServer metadata tags to be attached to MapServer layers.

getRangeType()

This method returns the range type of the coverage as RangeType object.

getSize()

This method shall return a tuple (xsize, ysize) for the coverage wrapped by the implementation. It has to be overridden by concrete coverage wrappers. By default this method raises InternalError.

getType()

This method shall return the internal coverage type code. It must be overridden by concrete coverage wrappers. By default this method raises InternalError.

See the definition of getType() in CoverageInterface for possible return values.

matches(filter_exprs)

Returns True if the Coverage matches the given filter expressions and False otherwise.

class eoxserver.resources.coverages.wrappers.DatasetSeriesWrapper

This is the wrapper for Dataset Series. It inherits from EOMetadataWrapper. It implements DatasetSeriesInterface.

FIELDS
  • eo_id: the EO ID of the dataset series; value must be a string
  • begin_time: the begin time of the eo metadata entry
  • end_time: the end time of the eo metadata entry
  • footprint: the footprint of the mosaic
addCoverage(wrapper)

Adds the EO coverage of type res_type with primary key res_id to the dataset series. An InternalError is raised if the type cannot be handled by Dataset Series. Supported wrapper types are:

  • eo.rect_dataset
  • eo.ref_dataset
  • eo.rect_stitched_mosaic
contains(wrapper)

This method returns True if the Dataset Series contains the EO Coverage specifiec by its wrapper, False otherwise.

getDataDirs()

This method returns a list of directories which hold the dataset series data.

getDatasets(filter_exprs=None)

This method returns a list of RectifiedDataset or ReferenceableDataset wrappers associated with the dataset series. It accepts an optional filter_exprs parameter which is expected to be a list of filter expressions (see module eoxserver.resources.coverages.filters) or None. Only the Datasets matching the filters will be returned; in case no matching Datasets are found an empty list will be returned.

getEOCoverages(filter_exprs=None)

This method returns a list of EOCoverage wrappers (for datasets and stitched mosaics) associated with the dataset series wrapped by the implementation. It accepts an optional filter_exprs parameter which is expected to be a list of filter expressions (see module eoxserver.resources.coverages.filters) or None. Only the EOCoverages matching the filters will be returned; in case no matching coverages are found an empty list will be returned.

getImagePattern()

Returns the filename pattern for image files to be included into the stitched mosaic. The pattern is expressed in the format accepted by fnmatch.fnmatch().

getType()

Returns "eo.dataset_series".

removeCoverage(wrapper)

Removes the EO coverage specified by its wrapper from the dataset series. An InternalError is raised if the type cannot be handled by Dataset Series. Supported wrapper types are:

  • eo.rect_dataset
  • eo.ref_dataset
  • eo.rect_stitched_mosaic
class eoxserver.resources.coverages.wrappers.EOCoverageWrapper

This is a partial implementation of EOCoverageInterface. It inherits from CoverageWrapper and EOMetadataWrapper.

getDatasets(filter_exprs=None)

This method shall return the datasets associated with this coverage, possibly filtered by the optional filter expressions. It must be overridden by child implementations. By default InternalError is raised.

getEOCoverageSubtype()

This method shall return the EO Coverage subtype according to the WCS 2.0 EO-AP (EO-WCS). It must be overridden by child implementations. By default InternalError is raised.

getLineage()

Returns None.

Note

The lineage element has yet to be specified in detail in the WCS 2.0 EO-AP (EO-WCS).

class eoxserver.resources.coverages.wrappers.EODatasetWrapper

This is the base class for EO Dataset wrapper implementations. It inherits from EOCoverageWrapper and PackagedDataWrapper.

getDatasets(filter_exprs=None)

This method applies the given filter expressions to the model and returns a list containing the wrapper in case the filters are matched or an empty list otherwise.

class eoxserver.resources.coverages.wrappers.EOMetadataWrapper

This wrapper class is intended as a mix-in for EO coverages and dataset series as defined in the WCS 2.0 EO-AP (EO-WCS).

getBeginTime()

Returns the acquisition begin time as datetime.datetime object.

getEOGML()

Returns the EO O&M XML text stored in the metadata.

getEOID()

Returns the EO ID of the object.

getEndTime()

Returns the acquisition end time as datetime.datetime object.

getFootprint()

Returns the acquisition footprint as django.contrib.gis.geos.GEOSGeometry object in the EPSG:4326 CRS.

getWGS84Extent()

Returns the WGS 84 extent as 4-tuple of floating point coordinates (minlon, minlat, maxlon, maxlat).

class eoxserver.resources.coverages.wrappers.PackagedDataWrapper

This wrapper is intended as a mix-in for coverages that are stored as data packages.

getData()

Return the data package wrapper associated with the coverage, i.e. an instance of a subclass of DataPackageWrapper.

getDataStructureType()

Returns the data structure type of the underlying data package

class eoxserver.resources.coverages.wrappers.RectifiedDatasetWrapper

This is the wrapper for Rectified Datasets. It inherits from EODatasetWrapper and RectifiedGridWrapper. It implements RectifiedDatasetInterface.

FIELDS
  • eo_id: the EO ID of the dataset; value must be a string
  • begin_time: the begin time of the eo metadata entry
  • end_time: the end time of the eo metadata entry
  • footprint: the footprint of the dataset
  • srid: the SRID of the dataset’s CRS; value must be an integer
  • size_x: the width of the coverage in pixels; value must be an integer
  • size_y: the height of the coverage in pixels; value must be an integer
  • minx: the left hand bound of the dataset’s extent; value must be numeric
  • miny: the lower bound of the dataset’s extent; value must be numeric
  • maxx: the right hand bound of the dataset’s extent; value must be numeric
  • maxy: the upper bound of the dataset’s extent; value must be numeric
  • visible: the visibility of the coverage (for DescribeCoverage requests); boolean
  • automatic: if the dataset was automatically created or by hand; boolean
containedIn(wrapper)

Returns True if this Rectified Dataset is contained in the Rectified Stitched Mosaic or Dataset Series specified by its wrapper, False otherwise.

contains(wrapper)

Always returns False. A Dataset does not contain other Datasets.

getContainerCount()

This method returns the number of Dataset Series and Rectified Stitched Mosaics containing this Rectified Dataset.

getContainers()

This method returns a list of DatasetSeriesWrapper and RectifiedStitchedMosaicWrapper objects containing this Rectified Dataset, or an empty list.

getCoverageSubtype()

Returns RectifiedGridCoverage.

getEOCoverageSubtype()

Returns RectifiedDataset.

getSize()

Returns the pixel size of the dataset as 2-tuple of integers (size_x, size_y).

getType()

Returns eo.rect_dataset

class eoxserver.resources.coverages.wrappers.RectifiedGridWrapper

This wrapper is intended as a mix-in for coverages that rely on a rectified grid. It implements RectifiedGridInterface.

getExtent()

Returns the coverage extent as a 4-tuple of floating point coordinates (minx, miny, maxx, maxy) expressed in the coverage CRS as defined by the SRID returned by getSRID().

getResolution()

Returns the coverage resolution as a 2-tuple of float values for the x and y axes (resx, resy) expressed in the unit of measure of the coverage CRS as defined by the SRID returned by getSRID().

getSRID()

Returns the SRID of the coverage CRS.

class eoxserver.resources.coverages.wrappers.RectifiedStitchedMosaicWrapper

This is the wrapper for Rectified Stitched Mosaics. It inherits from EOCoverageWrapper and RectifiedGridWrapper. It implements RectifiedStitchedMosaicInterface.

FIELDS
  • eo_id: the EO ID of the mosaic; value must be a string
  • begin_time: the begin time of the eo metadata entry
  • end_time: the end time of the eo metadata entry
  • footprint: the footprint of the mosaic
  • srid: the SRID of the mosaic’s CRS; value must be an integer
  • size_x: the width of the coverage in pixels; value must be an integer
  • size_y: the height of the coverage in pixels; value must be an integer
  • minx: the left hand bound of the mosaic’s extent; value must be numeric
  • miny: the lower bound of the mosaic’s extent; value must be numeric
  • maxx: the right hand bound of the mosaic’s extent; value must be numeric
  • maxy: the upper bound of the mosaic’s extent; value must be numeric
addCoverage(wrapper)

Adds a Rectified Dataset specified by its wrapper. An InternalError is raised if the wrapper type is not equal to eo.rect_dataset or if the grids of the dataset is not compatible to the grid of the Rectified Stitched Mosaic.

containedIn(wrapper)

This method returns True if this Stitched Mosaic is contained in the Dataset Series specified by its wrapper, False otherwise.

contains(wrapper)

This method returns True if the a Rectified Dataset specified by its wrapper is contained within this Stitched Mosaic, False otherwise.

getContainerCount()

This method returns the number of Dataset Series containing this Stitched Mosaic.

getContainers()

This method returns a list of DatasetSeriesWrapper objects containing this Stitched Mosaic or an empty list.

getCoverageSubtype()

Returns RectifiedGridCoverage.

getDataDirs()

This method returns a list of directories which hold the stitched mosaic data.

getDatasets(filter_exprs=None)

Returns a list of RectifiedDatasetWrapper objects contained in the stitched mosaic wrapped by the implementation. It accepts an optional filter_exprs parameter which is expected to be a list of filter expressions (see module eoxserver.resources.coverages.filters) or None. Only the datasets matching the filters will be returned; in case no matching coverages are found an empty list will be returned.

getEOCoverageSubtype()

Returns RectifiedStitchedMosaic.

getImagePattern()

Returns the filename pattern for image files to be included into the stitched mosaic. The pattern is expressed in the format accepted by fnmatch.fnmatch().

getShapeFilePath()

Returns the path to the shape file.

getSize()

Returns the pixel size of the mosaic as 2-tuple of integers (size_x, size_y).

getType()

Returns eo.rect_stitched_mosaic

removeCoverage(wrapper)

Removes a Rectified Dataset specified by its wrapper. An InternalError is raised if the wrapper type is not equal to eo.rect_dataset.

class eoxserver.resources.coverages.wrappers.ReferenceableDatasetWrapper

This is the wrapper for Referenceable Datasets. It inherits from EODatasetWrapper and ReferenceableGridWrapper.

FIELDS
  • eo_id: the EO ID of the dataset; value must be a string
  • begin_time: the begin time of the eo metadata entry
  • end_time: the end time of the eo metadata entry
  • footprint: the footprint of the dataset
  • filename: the path to the dataset; value must be a string
  • metadata_filename: the path to the accompanying metadata file; value must be a string
  • size_x: the width of the coverage in pixels; value must be an integer
  • size_y: the height of the coverage in pixels; value must be an integer
  • visible: the visible attribute of the dataset; value must be boolean
  • automatic: the automatic attribute of the dataset; value must be boolean

Note

The design of Referenceable Datasets is still TBD.

containedIn(wrapper)

This method returns True if this Referenceable Dataset is contained in the Dataset Series specified by its wrapper, False otherwise.

contains(wrapper)

Always returns False. A Dataset cannot contain other Datasets.

getContainerCount()

This method returns the number of Dataset Series containing this Referenceable Dataset.

getContainers()

This method returns a list of DatasetSeriesWrapper objects containing this Referenceable Dataset, or an empty list.

getCoverageSubtype()

Returns ReferenceableGridCoverage.

getEOCoverageSubtype()

Returns ReferenceableDataset.

getSize()

Returns the pixel size of the dataset as 2-tuple of integers (size_x, size_y).

getType()

Returns eo.ref_dataset

class eoxserver.resources.coverages.wrappers.ReferenceableGridWrapper

This wrapper is intended as a mix-in for coverages that rely on referenceable grids. It has yet to be implemented.

Note

The design for referenceable grids is yet TBD.

class eoxserver.resources.coverages.wrappers.TiledDataWrapper

This wrapper is intended as a mix-in for coverages that are stored in tile indices.

getData()

Returns a TileIndexWrapper instance.

getDataStructureType()

Returns "index".

Previous topic

Module eoxserver.resources.coverages.rangetype

Next topic

Module eoxserver.backends.base

This Page