Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
Ilwis::Coverage Class Reference

The Coverage class. More...

#include <coverage.h>

Inheritance diagram for Ilwis::Coverage:
Ilwis::IlwisObject Ilwis::Identity Ilwis::FeatureCoverage Ilwis::RasterCoverage

Public Types

enum  AttributeType { atCOVERAGE, atINDEX }
 
- Public Types inherited from Ilwis::IlwisObject
enum  ConnectorMode { cmINPUT =1, cmOUTPUT =2, cmEXTENDED =4 }
 The ConnectorMode enum Describes the state of the instance of the connector. More...
 
enum  StoreMode { smMETADATA =1, smBINARYDATA =2 }
 

Public Member Functions

 Coverage ()
 
 Coverage (const Resource &source)
 
ICoordinateSystem coordinateSystem () const
 
void coordinateSystem (const ICoordinateSystem &csy)
 
Envelope envelope () const
 
void envelope (const Envelope &bnds)
 
AttributeTable attributeTable (AttributeType attType=atCOVERAGE) const
 
AttributeTableattributeTable (AttributeType attType=atCOVERAGE)
 
bool hasAttributes (AttributeType attType=atCOVERAGE) const
 
void attributeTable (const ITable &tbl, AttributeType attType=atCOVERAGE)
 Sets a new Coveragetable or Indextable. More...
 
NumericStatisticsstatistics ()
 
const DataDefinitiondatadefIndex () const
 
DataDefinitiondatadefIndex ()
 
QVariant value (const QString &colName, quint32 itemid, qint32 layerIndex=-1)
 Returns a value in the Coverage- or Index-table. More...
 
Resource source (int mode=cmINPUT) const
 source the location of the source that represents the physical read origin of this object More...
 
double layerIndex (const QString &value)
 
void setLayerIndexes (const ItemRange &items)
 
void setName (const QString &nam)
 
bool prepare ()
 
- Public Member Functions inherited from Ilwis::IlwisObject
 IlwisObject ()
 
 IlwisObject (const Resource &source)
 
void setName (const QString &nm)
 
void setCode (const QString &cd)
 
QDateTime modifiedTime () const
 returns the moment when the object was last modified More...
 
void setModifiedTime (const Time &time)
 sets the last modified time of the object More...
 
Time createTime () const
 
void setCreateTime (const Time &time)
 
virtual QString toString ()
 translates the defintion of an object to a string representation More...
 
virtual void setConnector (ConnectorInterface *connector, int mode=cmINPUT|cmOUTPUT)
 connects an ilwisobject to an input or output source More...
 
virtual bool isEqual (const Ilwis::IlwisObject *obj) const
 isEqual compares the properties of ilwisobjects to test for equality. More...
 
virtual bool isValid () const
 isValid Tests the validity of an ilwisobject. More...
 
virtual bool isReadOnly () const
 isReadOnly tells if the source/target of the ilwisobject maybe modifiable. More...
 
virtual void setReadOnly (bool yesno)
 
virtual bool hasChanged () const
 
virtual void changed (bool yesno)
 
virtual IlwisTypes ilwisType () const =0
 
virtual bool prepare (const QString &def)
 prepare More...
 
bool fromInternal (const QSqlRecord &rec)
 
bool isAnonymous () const
 
virtual bool store (int mode=smMETADATA|smBINARYDATA)
 target the location of the source that represents the physical write target of this object More...
 
void connectTo (const QUrl &url, const QString &format, const QString &fnamespace, ConnectorMode cmode)
 
virtual IlwisObjectclone ()
 
virtual bool merge (const IlwisObject *obj, int options=0)
 
bool isSystemObject () const
 
bool isInternalObject () const
 
- Public Member Functions inherited from Ilwis::Identity
QString code () const
 code returns the code of the identity. If no code is attached it will return sUNDEF ("?"). More...
 
quint64 id () const
 id returns a unsigned 64-bit number unique for the objects using the identity More...
 
virtual QString name () const
 name returns the name of an object. All objects have names though names need not to be unique More...
 
void setName (const QString &n)
 setName sets the name of an object. All objects have names though names need not to be unique More...
 
virtual QString description () const
 
void setDescription (const QString &desc)
 

Protected Member Functions

void copyTo (IlwisObject *obj)
 
- Protected Member Functions inherited from Ilwis::IlwisObject
QScopedPointer
< ConnectorInterface > & 
connector (int mode=cmINPUT|cmOUTPUT)
 
const QScopedPointer
< ConnectorInterface > & 
connector (int mode=cmINPUT|cmOUTPUT) const
 
bool setValid (bool yesno)
 
void copyTo (IlwisObject *obj)
 
- Protected Member Functions inherited from Ilwis::Identity
 Identity (const QString &name, qint64 id=i64UNDEF, const QString &cde=sUNDEF, const QString &descr=sUNDEF)
 
void prepare (quint64 base=0)
 
void setId (quint64 newid)
 

Additional Inherited Members

- Static Public Member Functions inherited from Ilwis::IlwisObject
template<typename T >
static T create (const QString &def)
 
template<typename T >
static T create (quint64 id)
 
static IlwisObjectcreate (const Resource &source, const PrepareOptions &options=PrepareOptions())
 
static IlwisTypes findType (const QString &source)
 findType More...
 
static QString type2Name (IlwisTypes t)
 
static IlwisTypes name2Type (const QString &name)
 
static void addTypeFunction (IlwisTypeFunction)
 addTypeFunction More...
 
static IlwisTypes name2ExtendedType (const QString &dname)
 
- Protected Attributes inherited from Ilwis::IlwisObject
std::mutex _mutex
 
std::mutex _loadforstore
 

Detailed Description

The Coverage class.

In Ilwis we have two kinds of coverages. Raster coverages for imagery and feature coverages for vector data. A coverage controls the validity and meaning of data. A resource can be mapped to a coverage, and by this way be accessed

Member Enumeration Documentation

An AttributeTable can have 2 types depending on the object, it can be a coveragetable,
in which the features are defined at only 1 index, or it can be a indextable,
in which the features are defined at all known indexes.
the indexes can for example describe different measurements at different times

Constructor & Destructor Documentation

Coverage::Coverage ( )

The constructor for an empty coverage

Coverage::Coverage ( const Resource source)

The constructor for a RasterCoverage with a a Resource that is registered in the mastercatalog.
This resource must have a name and an Id.
Code and description are optional.

See Also
IlwisObject
Resource
Parameters
sourceResource that has to be used

Member Function Documentation

AttributeTable Coverage::attributeTable ( AttributeType  attType = atCOVERAGE) const

Gives the Coveragetable when called without parameter, and gives the indextable if you use atINDEX as parameter
atCOVERAGE as parameter also results in the attributeable

Parameters
attTypethe type of table required (atCOVERAGE or atINDEX)
Returns
an AttributeTable
AttributeTable & Coverage::attributeTable ( AttributeType  attType = atCOVERAGE)

Gives the Coveragetable when called without parameter, and gives the indextable if you use atINDEX as parameter
atCOVERAGE as parameter also results in the attributeable

Parameters
attTypethe type of table required (atCOVERAGE or atINDEX)
Returns
an AttributeTable
void Coverage::attributeTable ( const ITable tbl,
AttributeType  attType = atCOVERAGE 
)

Sets a new Coveragetable or Indextable.

When called without parameter, or with atCOVERAGE as parameter you will replace the Coveragetable
When called with atINDEX as parameter it will replace the Indextable

Parameters
tblthe new table
attTypethe type of the new table
ICoordinateSystem Coverage::coordinateSystem ( ) const

Query for the coordinate system of this coverage

See Also
ICoordinateSystem
Returns
the coordinate system if it has one or else null
void Coverage::coordinateSystem ( const ICoordinateSystem csy)

Changes the coordinate system of this coverage into the one specified
does not work if this coverage is readonly
sets the changed flag

See Also
ICoordinateSystem
Parameters
thenew coordinate system
const DataDefinition & Coverage::datadefIndex ( ) const

Returns the DataDefinition of this rastercoverage
can be null if it is not set

See Also
DataDefinition
Returns
the datadefinition of this rastercoverage
DataDefinition & Coverage::datadefIndex ( )

Returns the DataDefinition of this rastercoverage
can be null if it is not set

See Also
DataDefinition
Returns
the datadefinition of this rastercoverage
Envelope Coverage::envelope ( ) const

Query for the envelope of this coverage, must fit in the coordinate system
a envelope decides what domain within a coordinate system is valid, or in this case,
which part of the coordinate system is covered by this coverage
do note that the envelope should not be bigger than the coordinateSystem

Returns
the envelope of this coverage if it has one or else null
void Coverage::envelope ( const Envelope bnds)

Changes the envelope of this coverage to the one specified
a envelope decides what domain within a coordinate system is valid, or in this case,
which part of the coordinate system is covered by this coverage
do note that the envelope should not be bigger than the coordinateSystem
sets the changed flag

Parameters
thenew envelope
bool Coverage::hasAttributes ( Coverage::AttributeType  attType = atCOVERAGE) const

Checks for a valid attributetable.
the parameter decides between coverage and index table. anyhting different than atCOVERAGE or atINDEX is not allowed

Parameters
attTypemust be atCOVERAGE or atINDEX
Returns
true if this coverage has a valid table of the chosen type
double Coverage::layerIndex ( const QString &  value)

Translates a value to a index from the Indextable

note : the returned index is not necessarily an entry in the index table, as it is possible to get doubles or indices not in the table back
this happens for interpollation purposes and such. example:
the table : index 0 1 2 3 4
value 3 6 - 9 12
the - means undefined. if you now request 5, you will get 0.8 or something like that (depends on interpollation method etc)
if you request 7.5 you will probably get the index 2.0 , but the value at this index is actually not defined,
because for some reason this index is not entered in the table

Parameters
valuethe value that must be translated to a index
Returns
the index of the value
bool Coverage::prepare ( )
virtual

tries to Prepares this ilwisobject for use

Returns
true when the prepare succeeded

Reimplemented from Ilwis::IlwisObject.

Reimplemented in Ilwis::FeatureCoverage.

void Coverage::setLayerIndexes ( const ItemRange items)

Sets the supplied items at the indexes
only works when this coverage is not readonly
Uses the order specified in the itemrange itself

See Also
ItemRange
Parameters
itemsthe items that have to be added
void Coverage::setName ( const QString &  nam)

Changes the name of this coverage
only works if this coverage is not readonly
will also adjust the name of the attribute and or indextable
to respectively "name"_attributes and "name"_indexattributes

Parameters
namthe new name of this coverage
Resource Coverage::source ( int  mode = cmINPUT) const
virtual

source the location of the source that represents the physical read origin of this object

Returns
url that is sufficient to find the source

Reimplemented from Ilwis::IlwisObject.

Reimplemented in Ilwis::RasterCoverage.

NumericStatistics & Coverage::statistics ( )

Query for the NumbericStatistics of this coverage

Returns
the statistics of this coverage
QVariant Coverage::value ( const QString &  colName,
quint32  itemid,
qint32  layerIndex = -1 
)

Returns a value in the Coverage- or Index-table.

Using the colname and the itemid this function will return the correspondending value from the Coveragetable
if you add an index, the value will be retrieved from the Indextable instead.

Parameters
colNamename of the required collumn, must be a valid name
itemidid of the item in the collumn, must be a valid id
layerIndexthe index of the Indextable, default =-1 = Coveragetable any negative index other than -1, will cause errors
Returns
the requested value, when all parameters are valid

The documentation for this class was generated from the following files: