Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
The RasterCoverage class. More...
#include <rastercoverage.h>
Public Member Functions | |
RasterCoverage () | |
RasterCoverage (const Resource &resource) | |
IlwisTypes | ilwisType () const |
virtual RasterCoverage * | clone () |
const DataDefinition & | datadef () const |
DataDefinition & | datadef () |
const Ilwis::IGeoReference & | georeference () const |
void | georeference (const IGeoReference &grf) |
Replaces the existing IGeoReference with a new one. More... | |
Size | size () const |
void | size (const Size<> &sz) |
void | copyBinary (const IlwisData< RasterCoverage > &raster, int index) |
copyBinary Copies the binary data of this RasterCoverage More... | |
double | coord2value (const Coordinate &c) |
double | pix2value (const Pixeld &pix) |
Resource | source (int mode=cmINPUT) const |
source the location of the source that represents the physical read origin of this object More... | |
void | unloadBinary () |
PixelIterator | end () |
PixelIterator | begin () |
![]() | |
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... | |
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 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 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 | |
Grid * | grid () |
void | copyTo (IlwisObject *obj) |
![]() | |
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) |
Protected Attributes | |
QScopedPointer< Grid > | _grid |
Friends | |
class | PixelIterator |
class | GridBlock |
class | Grid |
class | RasterInterpolator |
Additional Inherited Members | |
![]() | |
enum | AttributeType { atCOVERAGE, atINDEX } |
![]() | |
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) |
The RasterCoverage class.
In Ilwis-Objects remote sensing imagery is accessed through raster-coverages. In this context a raster-coverage is a stack of 2D rasters (1..n) in which all layers of the stack have the same raster size and pixel size. The z component is referred to as the ‘layer-index’ or ‘index’. A layer is always rectangular as are its pixels. As a raster coverage relation between its pixels and the real world is covered by the georeference class. It translates pixel positions to real world coordinates and vice-versa.
In a RasterCoverage we use 2 kinds of attribute tables: Index-tables and Coverage-tables. A Coverage-table has object data in its initial position, the Index table has records at all other positions.
In order to get a rastervalue you need to use either coord2value() or pix2value(), where coord2value simply translates the coordinates to pixels and calls pix2value with those. The returned value is always a double or undefined. undefined values only happen when you query outside the raster, or when the raster is not fully initialized.
RasterCoverage::RasterCoverage | ( | ) |
The constructor for an empty RasterCoverage
RasterCoverage::RasterCoverage | ( | const Resource & | resource | ) |
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.
resource | The resource to use |
|
virtual |
Copies (clones) this rastercoverage to a new raster with a new unique id.
Also copies all of the binary data.
Reimplemented from Ilwis::IlwisObject.
|
inline |
transforms a certain coordinate to relevant the value
The coordinate must fit in the raster, and can either be 2D or 3D
This function will use the georeference to transform the coordinates in pixels
and use those pixels to call the pix2value()
c | the coordinate |
void RasterCoverage::copyBinary | ( | const IlwisData< RasterCoverage > & | raster, |
int | index | ||
) |
copyBinary Copies the binary data of this RasterCoverage
The data will be coppied on the supplied raster, the index decides the starting layer of the copy,
and the size of the raster decides the endpoint. only works when both rasters have the same geometrie and domain
raster | The target of the binary copy |
index | The starting point of the copy |
const IGeoReference & RasterCoverage::georeference | ( | ) | const |
Returns a reference to the IGeoReference of this RasterCoverage.
Can be null if it is not set.
void RasterCoverage::georeference | ( | const IGeoReference & | grf | ) |
Replaces the existing IGeoReference with a new one.
Replaces the old IGeoReference with the new one, if the georeference is not null.
It also resets the binary data because the new georeference can have a different size, making the original data invalid.
If the georeference is valid it computes and sets the new coordinatesystem and the new size.
grf | the new georeference |
|
virtual |
Gives the IlwisTypes of this object
Implements Ilwis::IlwisObject.
|
inline |
transforms the value of a certain pixel in the grid to the relevant value
The pixel point, be it 2D or 3D must fit in envelope of this coverage for this function to return an actual value,
if the pixel does not fit in the rastersize, it will return undefined.
if the grid is null, it will also return undefined
This function requires a valid georeference and a non null grid, if this is not the case undefined will be returned
this function is rather inefficient, see PixelIterator if you require efficiency (recommended if you want to retrieve multiple pixels)
pix | the pixel |
Size RasterCoverage::size | ( | ) | const |
Returns the size of this RasterCoverage
A size can, depending on the raster either be 2D or 3D.
Size in row-col for 2D.
And in row-col-heigth for 3D.
void RasterCoverage::size | ( | const Size<> & | sz | ) |
Assigns a new size to this RasterCoverage.
Size in row-col for 2D.
And in row-col-heigth for 3D.
The Size cannot be changed if this rastercoverage is readonly.
Also changes the size of the georeference.
sz | the new size, must always be positive or undefined |
|
virtual |
source the location of the source that represents the physical read origin of this object
Reimplemented from Ilwis::Coverage.
void RasterCoverage::unloadBinary | ( | ) |
unload the grid, generally used to clear some memory