openModeller  Version 1.5.0
Map.hh
Go to the documentation of this file.
1 
28 #ifndef _MAPHH_
29 #define _MAPHH_
30 
31 #include <openmodeller/om_defs.hh>
34 
35 #include <string>
36 
37 class GeoTransform;
38 
39 /****************************************************************/
40 /****************************** Map *****************************/
41 
48 /*******/
49 class dllexp Map
50 {
51 public:
52 
60  Map( Raster *rst );
61  ~Map();
62 
64  {
65  return MapIterator( _rst->header(), _gt );
66  }
67 
68  const Header& getHeader() const { return _rst->header(); }
69 
70  int isCategorical() const { return _rst->isCategorical(); }
71 
73  void setMinMax( Scalar min, Scalar max )
74  {
75  _rst->setMinMax( min, max );
76  }
77 
78  bool hasMinMax() const
79  {
80  return _rst->hasMinMax();
81  }
82 
84  int getMinMax( Scalar *min, Scalar *max ) const
85  {
86  return _rst->getMinMax( min, max );
87  }
88 
90  int numBand() const { return _rst->numBand(); }
91 
93  int getExtent( Coord *xmin, Coord *ymin, Coord *xmax, Coord *ymax) const;
94 
96  int getDim( int *xdim, int *ydim ) const
97  {
98  *xdim = _rst->dimX(); *ydim = _rst->dimY(); return 1;
99  }
100 
102  int getCell( Coord *xcel, Coord *ycel ) const
103  {
104  *xcel = _rst->celX(); *ycel = _rst->celY(); return 1;
105  }
106 
111  int get( Coord x, Coord y, Scalar *val ) const;
112 
118  int put( Coord x, Coord y, Scalar val );
119 
125  int put( Coord x, Coord y );
126 
127  GeoTransform *getGT() const { return _gt; }
128 
133  int getRowColumn( Coord x, Coord y, int *row, int *col );
134 
138  void finish();
139 
144  int deleteRaster();
145 
146 private:
147 
150 
151  // Disable copying.
152  Map( const Map& );
153  Map& operator=( const Map& );
154 
155 };
156 
157 
158 #endif
159 
MapIterator begin() const
Definition: Map.hh:63
bool hasMinMax() const
Definition: Map.hh:78
int numBand() const
Definition: Map.hh:90
double Scalar
Type of map values.
Definition: om_defs.hh:39
int getDim(int *xdim, int *ydim) const
Definition: Map.hh:96
A common interface to rasters.
Definition: Raster.hh:44
int getCell(Coord *xcel, Coord *ycel) const
Definition: Map.hh:102
GeoTransform * _gt
Definition: Map.hh:149
Definition: Header.hh:45
GeoTransform * getGT() const
Definition: Map.hh:127
void setMinMax(Scalar min, Scalar max)
Definition: Map.hh:73
const Header & getHeader() const
Definition: Map.hh:68
int getMinMax(Scalar *min, Scalar *max) const
Definition: Map.hh:84
Definition: Map.hh:49
Raster * _rst
Definition: Map.hh:148
int isCategorical() const
Definition: Map.hh:70
double Coord
Type of map coordinates.
Definition: om_defs.hh:38
int min(int v1, int v2)
Definition: rules_base.cpp:56