Package eoxserver :: Package resources :: Package coverages :: Module data :: Class DataPackageWrapper
[hide private]
[frames] | no frames]

Class DataPackageWrapper

source code


This is the common base class for data package wrappers. It derives from :class:`~.RecordWrapper`. .. method:: setAttrs(**kwargs) :class:`DataPackageWrapper` defines three attributes that can be assigned to any data package instance: * ``location``: the location of the data; the location type depends on the concrete data package subclass * ``metadata_location``: the location of the metadata; the location type depends on the concrete data package subclass * ``metadata_format_name``: the name of the metadata format; can be derived automatically from the metadata using :meth:`readEOMetadata` .. method:: sync See :meth:`.RecordWrapper.sync`. .. method:: getRecord See :meth:`.RecordWrapper.getRecord`
Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
open(self)
Open the underlying dataset with GDAL and return a :class:`osgeo.gdal.Dataset` object.
source code
 
getSourceFormat(self)
Return the source data file format.
source code
 
getLocation(self)
Return the location of the data, i.e.
source code
 
getMetadataLocation(self)
Return the location of the metadata, i.e.
source code
 
getCoverages(self)
Return the coverages that use this data package.
source code
 
readGeospatialMetadata(self, default_srid=None)
Read geospatial metadata from the underlying dataset.
source code
 
readEOMetadata(self)
Read EO Metadata from the metadata location and return an :class:`~.EOMetadata` instance.
source code
 
prepareAccess(self)
Prepare access to the underlying dataset.
source code
 
getAccessibleLocation(self)
Get an accessible location of the underlying dataset.
source code
 
getGDALDatasetIdentifier(self)
Get a GDAL dataset identifier for the underlying dataset, i.e.
source code
 
_validate_attrs(self, **kwargs) source code
 
_set_attrs(self, **kwargs) source code
 
_fetch_unique_record(self) source code
 
_get_query(self, fields=None) source code
 
_prepare_metadata_access(self) source code
 
_get_accessible_metadata_location(self) source code
 
_post_metadata_access(self) source code

Inherited from core.records.RecordWrapper: delete, getRecord, getType, setAttrs, setRecord, sync

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

open(self)

source code 
Open the underlying dataset with GDAL and return a :class:`osgeo.gdal.Dataset` object. This method raises :exc:`~.EngineError` if GDAL was not able to open the dataset. It raises :exc:`~.DataAccessError` if the dataset could not be made accessible to GDAL (e.g. download of a remote FTP resource failed).

getLocation(self)

source code 
Return the location of the data, i.e. an object implementing :class:`~.LocationInterface`. The location type depends on the concrete data package subclass.

getMetadataLocation(self)

source code 
Return the location of the metadata, i.e. an object implementing :class:`~.LocationInterface`. The location type depends on the concrete data package subclass.

readGeospatialMetadata(self, default_srid=None)

source code 
Read geospatial metadata from the underlying dataset. The return value is a :class:`~.GeospatialMetadata` instance. The method accepts an optional integer ``default_srid`` argument which predefines the output SRID if it cannot be retrieved from the dataset; see :meth:`~.GeospatialMetadata.readFromDataset`. The dataset is opened using :meth:`open`; it may raise :exc:`~.DataAccessError` or :exc:`~.EngineError` in the error cases described there.

readEOMetadata(self)

source code 
Read EO Metadata from the metadata location and return an :class:`~.EOMetadata` instance. :exc:`~.DataAccessError` may be raised if the metadata location cannot be made accessible (e.g. an XML metadata file cannot be retrieved from a remote location). :exc:`~.MetadataException` will be raised if the metadata cannot be read (e.g. because a metadata file does not contain valid XML).

prepareAccess(self)

source code 
Prepare access to the underlying dataset. This makes the underlying dataset accessible so that :meth:`getAccessibleLocation` and :meth:`getGDALDatasetIdentifier` can yield meaningful results. Concrete subclasses have to override this. By default :exc:`~.InternalError` is raised.

getAccessibleLocation(self)

source code 
Get an accessible location of the underlying dataset. A previous successful call to :meth:`prepareAccess` may be necessary for this method to yield a meaningful result. Concrete subclasses have to override this. By default :exc:`~.InternalError` is raised.

getGDALDatasetIdentifier(self)

source code 
Get a GDAL dataset identifier for the underlying dataset, i.e. the string to be passed on to the :func:`gdal.Open` function. A previous successful call to :meth:`prepareAccess` may be necessary for this method to yield a meaningful result. Concrete subclasses have to override this. By default :exc:`~.InternalError` is raised.

_validate_attrs(self, **kwargs)

source code 
Overrides: core.records.RecordWrapper._validate_attrs

_set_attrs(self, **kwargs)

source code 
Overrides: core.records.RecordWrapper._set_attrs

_fetch_unique_record(self)

source code 
Overrides: core.records.RecordWrapper._fetch_unique_record

_get_query(self, fields=None)

source code 
Overrides: core.records.RecordWrapper._get_query