Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
#include <coverage.h>
Public Types | |
enum | AttributeType { atCOVERAGE, atINDEX } |
![]() | |
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 |
AttributeTable & | attributeTable (AttributeType attType=atCOVERAGE) |
bool | hasAttributes (AttributeType attType=atCOVERAGE) const |
void | attributeTable (const ITable &tbl, AttributeType attType=atCOVERAGE) |
Sets a new Coveragetable or Indextable. More... | |
NumericStatistics & | statistics () |
const DataDefinition & | datadefIndex () const |
DataDefinition & | datadefIndex () |
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 () |
![]() | |
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 IlwisObject * | clone () |
virtual bool | merge (const IlwisObject *obj, int options=0) |
bool | isSystemObject () const |
bool | isInternalObject () const |
![]() | |
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) |
![]() | |
QScopedPointer < ConnectorInterface > & | connector (int mode=cmINPUT|cmOUTPUT) |
const QScopedPointer < ConnectorInterface > & | connector (int mode=cmINPUT|cmOUTPUT) const |
bool | setValid (bool yesno) |
void | copyTo (IlwisObject *obj) |
![]() | |
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 | |
![]() | |
template<typename T > | |
static T | create (const QString &def) |
template<typename T > | |
static T | create (quint64 id) |
static IlwisObject * | create (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) |
![]() | |
std::mutex | _mutex |
std::mutex | _loadforstore |
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
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
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.
source | Resource that has to be used |
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
attType | the type of table required (atCOVERAGE or atINDEX) |
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
attType | the type of table required (atCOVERAGE or atINDEX) |
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
tbl | the new table |
attType | the type of the new table |
ICoordinateSystem Coverage::coordinateSystem | ( | ) | const |
Query for the coordinate system of this coverage
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
the | new coordinate system |
const DataDefinition & Coverage::datadefIndex | ( | ) | const |
Returns the DataDefinition of this rastercoverage
can be null if it is not set
DataDefinition & Coverage::datadefIndex | ( | ) |
Returns the DataDefinition of this rastercoverage
can be null if it is not set
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
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
the | new 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
attType | must be atCOVERAGE or atINDEX |
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
value | the value that must be translated to a index |
|
virtual |
tries to Prepares this ilwisobject for use
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
items | the 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
nam | the new name of this coverage |
|
virtual |
source the location of the source that represents the physical read origin of this object
Reimplemented from Ilwis::IlwisObject.
Reimplemented in Ilwis::RasterCoverage.
NumericStatistics & Coverage::statistics | ( | ) |
Query for the NumbericStatistics 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.
colName | name of the required collumn, must be a valid name |
itemid | id of the item in the collumn, must be a valid id |
layerIndex | the index of the Indextable, default =-1 = Coveragetable any negative index other than -1, will cause errors |