iLand
|
#include <mapgrid.h>
Public Member Functions | |
MapGrid () | |
MapGrid (const GisGrid &source_grid) | |
create a MapGrid. the optional parameter "create_index" indicates if a spatial index (e.g. to query all pixels with a given value) should be built. More... | |
MapGrid (const QString &fileName, const bool create_index=true) | |
bool | loadFromFile (const QString &fileName, const bool create_index=true) |
load ESRI style text file More... | |
bool | loadFromGrid (const GisGrid &source_grid, const bool create_index=true) |
load from an already present GisGrid More... | |
void | createEmptyGrid () |
create an empty grid with the size of the height grid of iLand (all values are 0, no index is created) More... | |
void | createIndex () |
(re-)creates the internal index (mRUIndex, mRectIndex, ...) More... | |
const QString & | name () const |
bool | isValid () const |
const Grid< int > & | grid () const |
int | count () const |
number of stands stored in the index More... | |
bool | isValid (const int id) const |
returns true, if 'id' is a valid id in the grid, false otherwise. More... | |
QRectF | boundingBox (const int id) const |
returns the bounding box of a polygon More... | |
double | area (const int id) const |
return the area (m2) covered by the polygon More... | |
QList< ResourceUnit * > | resourceUnits (const int id) const |
returns the list of resource units with at least one pixel within the area designated by 'id' More... | |
QList< QPair< ResourceUnit *, double > > | resourceUnitAreas (const int id) const |
returns a list with resource units and area factors per 'id'. More... | |
QList< Tree * > | trees (const int id) const |
return a list of all living trees on the area 'id' More... | |
int | loadTrees (const int id, QVector< QPair< Tree *, double > > &rList, const QString filter=QString(), int n_estimate=0) const |
load trees and store in list 'rList'. If 'filter'<>"", then the filter criterion is applied More... | |
QList< int > | gridIndices (const int id) const |
return a list of grid-indices of a given stand-id More... | |
const QMultiHash< int, int > | neighborList () const |
extract a list of neighborhood relationships between all the polygons of the grid More... | |
void | updateNeighborList () |
scan the map and fill the mNeighborList More... | |
QList< int > | neighborsOf (const int index) const |
retrieve a list of saplings on a given stand polygon. More... | |
bool | hasValue (const int id, const QPoint &lif_grid_coords) const |
return true, if the point 'lif_grid_coords' (x/y integer key within the LIF-Grid) More... | |
int | standIDFromLIFCoord (const QPoint &lif_grid_coords) const |
return the stand-ID at the coordinates from the LIF-Grid (i.e., 2m grid). More... | |
Static Public Member Functions | |
static void | freeLocksForStand (const int id) |
free locks for a given stand More... | |
MapGrid::MapGrid | ( | ) |
|
inline |
create a MapGrid. the optional parameter "create_index" indicates if a spatial index (e.g. to query all pixels with a given value) should be built.
|
inline |
|
inline |
return the area (m2) covered by the polygon
|
inline |
returns the bounding box of a polygon
|
inline |
number of stands stored in the index
void MapGrid::createEmptyGrid | ( | ) |
create an empty grid with the size of the height grid of iLand (all values are 0, no index is created)
void MapGrid::createIndex | ( | ) |
(re-)creates the internal index (mRUIndex, mRectIndex, ...)
|
static |
free locks for a given stand
|
inline |
QList< int > MapGrid::gridIndices | ( | const int | id | ) | const |
return a list of grid-indices of a given stand-id
return a list of grid-indices of a given stand-id (a grid-index is the index of 10m x 10m pixels within the internal storage) The selection is limited to pixels within the world's extent
|
inline |
return true, if the point 'lif_grid_coords' (x/y integer key within the LIF-Grid)
|
inline |
|
inline |
returns true, if 'id' is a valid id in the grid, false otherwise.
bool MapGrid::loadFromFile | ( | const QString & | fileName, |
const bool | create_index = true |
||
) |
load ESRI style text file
bool MapGrid::loadFromGrid | ( | const GisGrid & | source_grid, |
const bool | create_index = true |
||
) |
load from an already present GisGrid
int MapGrid::loadTrees | ( | const int | id, |
QVector< QPair< Tree *, double > > & | rList, | ||
const QString | filter = QString() , |
||
int | n_estimate = 0 |
||
) | const |
load trees and store in list 'rList'. If 'filter'<>"", then the filter criterion is applied
|
inline |
|
inline |
extract a list of neighborhood relationships between all the polygons of the grid
QList< int > MapGrid::neighborsOf | ( | const int | index | ) | const |
retrieve a list of saplings on a given stand polygon.
retrieve a list of all stands that are neighbors of the stand with ID "index".
|
inline |
returns a list with resource units and area factors per 'id'.
the area is '1' if the resource unit is fully covered by the grid-value.
QList< ResourceUnit * > MapGrid::resourceUnits | ( | const int | id | ) | const |
returns the list of resource units with at least one pixel within the area designated by 'id'
|
inline |
return the stand-ID at the coordinates from the LIF-Grid (i.e., 2m grid).
QList< Tree * > MapGrid::trees | ( | const int | id | ) | const |
return a list of all living trees on the area 'id'
return a list of all living trees on the area denoted by 'id'
void MapGrid::updateNeighborList | ( | ) |
scan the map and fill the mNeighborList
scan the map and add neighborhood-relations to the mNeighborList the 4-neighborhood is used to identify neighbors.