openModeller
Version 1.4.0
|
#include <Map.hh>
Public Member Functions | |
Map (Raster *rst) | |
~Map () | |
MapIterator | begin () const |
const Header & | getHeader () const |
int | isCategorical () const |
void | setMinMax (Scalar min, Scalar max) |
bool | hasMinMax () const |
int | getMinMax (Scalar *min, Scalar *max) const |
int | numBand () const |
int | getExtent (Coord *xmin, Coord *ymin, Coord *xmax, Coord *ymax) const |
int | getDim (int *xdim, int *ydim) const |
int | getCell (Coord *xcel, Coord *ycel) const |
int | get (Coord x, Coord y, Scalar *val) const |
int | put (Coord x, Coord y, Scalar val) |
int | put (Coord x, Coord y) |
GeoTransform * | getGT () const |
int | getRowColumn (Coord x, Coord y, int *row, int *col) |
void | finish () |
int | deleteRaster () |
Private Member Functions | |
Map (const Map &) | |
Map & | operator= (const Map &) |
Private Attributes | |
Raster * | _rst |
GeoTransform * | _gt |
Responsable for the geografical and projectional transformations related to reading and writing in raster maps.
Create a new map based on a predefined raster. The Map takes ownership of the Raster object pointed to by rst. It will be deleted when this is deleted.
rst | Raster object |
Definition of Map class.
LICENSE INFORMATION
Copyright(c) 2003 by CRIA - Centro de Referencia em Informacao Ambiental
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html
Definition at line 43 of file Map.cpp.
References _gt, _rst, GeoTransform::getDefaultCS(), Raster::header(), and Header::proj.
MapIterator Map::begin | ( | ) | const [inline] |
Definition at line 63 of file Map.hh.
References _gt, _rst, and Raster::header().
Referenced by Projector::createMap().
int Map::deleteRaster | ( | ) |
Deletes the associated raster.
Definition at line 162 of file Map.cpp.
References _rst, and Raster::deleteRaster().
Referenced by Projector::createMap().
void Map::finish | ( | ) |
Event that must be called to indicate when the projection is finished.
Definition at line 154 of file Map.cpp.
References _rst, and Raster::finish().
Referenced by Projector::createMap().
Fills 'val' with the map bands values at (x,y). Returns zero if (x,y) is not defined in the map.
Definition at line 104 of file Map.cpp.
References _gt, _rst, Raster::get(), and GeoTransform::transfIn().
Referenced by draw_map(), and main().
int Map::getCell | ( | Coord * | xcel, |
Coord * | ycel | ||
) | const [inline] |
Cell width (in map units)
Definition at line 102 of file Map.hh.
References _rst, Raster::celX(), and Raster::celY().
Referenced by main().
int Map::getDim | ( | int * | xdim, |
int * | ydim | ||
) | const [inline] |
Map dimensions.
Definition at line 96 of file Map.hh.
References _rst, Raster::dimX(), and Raster::dimY().
int Map::getExtent | ( | Coord * | xmin, |
Coord * | ymin, | ||
Coord * | xmax, | ||
Coord * | ymax | ||
) | const |
Get the map limits.
Definition at line 63 of file Map.cpp.
References _gt, _rst, Raster::getExtentInStandardCs(), Raster::hasCustomGeotransform(), GeoTransform::transfOut(), Raster::xMax(), Raster::xMin(), Raster::yMax(), and Raster::yMin().
Referenced by findRegion().
GeoTransform* Map::getGT | ( | ) | const [inline] |
const Header& Map::getHeader | ( | ) | const [inline] |
Definition at line 68 of file Map.hh.
References _rst, and Raster::header().
Referenced by MapFormat::copyDefaults(), and Projector::createMap().
int Map::getMinMax | ( | Scalar * | min, |
Scalar * | max | ||
) | const [inline] |
Find the minimum and maximum values in the first band.
Definition at line 84 of file Map.hh.
References _rst, and Raster::getMinMax().
Referenced by EnvironmentImpl::getMinMax().
int Map::getRowColumn | ( | Coord | x, |
Coord | y, | ||
int * | row, | ||
int * | col | ||
) |
Return row and column for the given coordinates.
Definition at line 128 of file Map.cpp.
References _gt, _rst, Raster::dimX(), Raster::dimY(), GeoTransform::transfIn(), Raster::xMax(), Raster::xMin(), Raster::yMax(), and Raster::yMin().
Referenced by SamplerImpl::isSpatiallyUnique(), and SamplerImpl::spatiallyUnique().
bool Map::hasMinMax | ( | ) | const [inline] |
Definition at line 78 of file Map.hh.
References _rst, and Raster::hasMinMax().
int Map::isCategorical | ( | ) | const [inline] |
Definition at line 70 of file Map.hh.
References _rst, and Raster::isCategorical().
int Map::numBand | ( | ) | const [inline] |
Number of bands.
Definition at line 90 of file Map.hh.
References _rst, and Raster::numBand().
Referenced by draw_map(), and main().
Put the values at 'val' in the first band at (x,y).
Definition at line 112 of file Map.cpp.
References _gt, _rst, Raster::put(), and GeoTransform::transfIn().
Referenced by Projector::createMap().
Put the value for noval in the first band at (x,y).
Definition at line 120 of file Map.cpp.
References _gt, _rst, Raster::put(), and GeoTransform::transfIn().
void Map::setMinMax | ( | Scalar | min, |
Scalar | max | ||
) | [inline] |
Support external specification of the min/max
Definition at line 73 of file Map.hh.
References _rst, and Raster::setMinMax().
GeoTransform* Map::_gt [private] |
Definition at line 149 of file Map.hh.
Referenced by begin(), get(), getExtent(), getGT(), getRowColumn(), Map(), put(), and ~Map().
Definition at line 148 of file Map.hh.
Referenced by begin(), deleteRaster(), finish(), get(), getCell(), getDim(), getExtent(), getHeader(), getMinMax(), getRowColumn(), hasMinMax(), isCategorical(), Map(), numBand(), put(), setMinMax(), and ~Map().