iLand
Public Member Functions | Static Public Member Functions | List of all members
GisGrid Class Reference

GisGrid encapsulates a simple grid of values based on GIS data. More...

#include <gisgrid.h>

Public Member Functions

 GisGrid ()
 
 ~GisGrid ()
 
bool loadFromFile (const QString &fileName)
 load ESRI style text file More...
 
int dataSize () const
 number of data items (rows*cols) More...
 
int rows () const
 number of rows More...
 
int cols () const
 number of columns More...
 
QPointF origin () const
 coordinates of the lower left corner of the grid More...
 
double cellSize () const
 size of a cell (meters) More...
 
double minValue () const
 minimum data value More...
 
double maxValue () const
 maximum data value More...
 
int noDataValue () const
 no data value of the grid More...
 
double value (const QPointF &p) const
 get grid value at local coordinates (X/Y); returs NODATAValue if out of range X and Y are local coordinates. More...
 
double value (const double X, const double Y) const
 
double value (const int indexx, const int indexy) const
 get value of grid at index positions More...
 
double value (const int Index) const
 get value of grid at index positions More...
 
Vector3D coord (const int Index) const
 get coordinates of the center of the cell with 'Index' More...
 
Vector3D coord (const int indexx, const int indexy) const
 
QRectF rectangle (const int indexx, const int indexy) const
 
void clip (const QRectF &box)
 clip the grid to 'Box' (set values outside to -1) More...
 
QList< double > distinctValues ()
 returns a list of distinct values More...
 

Static Public Member Functions

static QPointF modelToWorld (QPointF model_coordinates)
 convert model to world coordinates (metric) More...
 
static QPointF worldToModel (QPointF world_coordinates)
 convert world (i.e. GIS) to model coordinates (metric) (with 0/0 at lower left edge of project area) More...
 

Detailed Description

GisGrid encapsulates a simple grid of values based on GIS data.

GisGrid can load input files in ESRI text file format (loadFromFile()) and transforms coordinates to the current reference in iLand.

Constructor & Destructor Documentation

◆ GisGrid()

GisGrid::GisGrid ( )

◆ ~GisGrid()

GisGrid::~GisGrid ( )

Member Function Documentation

◆ cellSize()

double GisGrid::cellSize ( ) const
inline

size of a cell (meters)

◆ clip()

void GisGrid::clip ( const QRectF &  box)

clip the grid to 'Box' (set values outside to -1)

◆ cols()

int GisGrid::cols ( ) const
inline

number of columns

◆ coord() [1/2]

Vector3D GisGrid::coord ( const int  Index) const

get coordinates of the center of the cell with 'Index'

◆ coord() [2/2]

Vector3D GisGrid::coord ( const int  indexx,
const int  indexy 
) const

◆ dataSize()

int GisGrid::dataSize ( ) const
inline

number of data items (rows*cols)

◆ distinctValues()

QList< double > GisGrid::distinctValues ( )

returns a list of distinct values

◆ loadFromFile()

bool GisGrid::loadFromFile ( const QString &  fileName)

load ESRI style text file

◆ maxValue()

double GisGrid::maxValue ( ) const
inline

maximum data value

◆ minValue()

double GisGrid::minValue ( ) const
inline

minimum data value

◆ modelToWorld()

QPointF GisGrid::modelToWorld ( QPointF  model_coordinates)
static

convert model to world coordinates (metric)

◆ noDataValue()

int GisGrid::noDataValue ( ) const
inline

no data value of the grid

◆ origin()

QPointF GisGrid::origin ( ) const
inline

coordinates of the lower left corner of the grid

◆ rectangle()

QRectF GisGrid::rectangle ( const int  indexx,
const int  indexy 
) const

◆ rows()

int GisGrid::rows ( ) const
inline

number of rows

◆ value() [1/4]

double GisGrid::value ( const double  X,
const double  Y 
) const

◆ value() [2/4]

double GisGrid::value ( const int  Index) const

get value of grid at index positions

◆ value() [3/4]

double GisGrid::value ( const int  indexx,
const int  indexy 
) const

get value of grid at index positions

◆ value() [4/4]

double GisGrid::value ( const QPointF &  p) const
inline

get grid value at local coordinates (X/Y); returs NODATAValue if out of range X and Y are local coordinates.

◆ worldToModel()

QPointF GisGrid::worldToModel ( QPointF  world_coordinates)
static

convert world (i.e. GIS) to model coordinates (metric) (with 0/0 at lower left edge of project area)


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