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

The RasterCoverage class. More...

#include <rastercoverage.h>

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

Public Member Functions

 RasterCoverage ()
 
 RasterCoverage (const Resource &resource)
 
IlwisTypes ilwisType () const
 
virtual RasterCoverageclone ()
 
const DataDefinitiondatadef () const
 
DataDefinitiondatadef ()
 
const Ilwis::IGeoReferencegeoreference () 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 ()
 
- Public Member Functions inherited from Ilwis::Coverage
 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...
 
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 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
 
- 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

Gridgrid ()
 
void copyTo (IlwisObject *obj)
 
- Protected Member Functions inherited from Ilwis::Coverage
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)
 

Protected Attributes

QScopedPointer< Grid_grid
 

Friends

class PixelIterator
 
class GridBlock
 
class Grid
 
class RasterInterpolator
 

Additional Inherited Members

- Public Types inherited from Ilwis::Coverage
enum  AttributeType { atCOVERAGE, atINDEX }
 
- 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)
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

See Also
IlwisObject
Resource
Parameters
resourceThe resource to use

Member Function Documentation

RasterCoverage * RasterCoverage::clone ( )
virtual

Copies (clones) this rastercoverage to a new raster with a new unique id.
Also copies all of the binary data.

Returns
a copy of this rastercoverage

Reimplemented from Ilwis::IlwisObject.

double Ilwis::RasterCoverage::coord2value ( const Coordinate c)
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()

See Also
pix2value()
Parameters
cthe coordinate
Returns
the value at the coordinates or undefined
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

Parameters
rasterThe target of the binary copy
indexThe 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.

Returns
the georeference
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.

Parameters
grfthe new georeference
IlwisTypes RasterCoverage::ilwisType ( ) const
virtual

Gives the IlwisTypes of this object

See Also
IlwisObject
Returns
the IlwisTypes of this IlwisObject

Implements Ilwis::IlwisObject.

double Ilwis::RasterCoverage::pix2value ( const Pixeld pix)
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)

See Also
PixelIterator
Parameters
pixthe pixel
Returns
the value at the pixel or undefined
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.

See Also
Size
Returns
the size of this RasterCoverage
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.

See Also
Size
Parameters
szthe new size, must always be positive or undefined
Resource RasterCoverage::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::Coverage.

void RasterCoverage::unloadBinary ( )

unload the grid, generally used to clear some memory


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