All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Band.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/raster/Band.cpp
22 
23  \brief It gives access to values in one band (dimension) of a raster.
24 */
25 
26 // TerraLib
27 
28 #include "Band.h"
29 #include "BandProperty.h"
30 #include "PositionIterator.h"
31 #include "Utils.h"
32 
33 // STL
34 #include <cassert>
35 #include <limits>
36 
37 te::rst::Band::Band(BandProperty* p, std::size_t idx)
38  : m_property(p),
39  m_idx(idx)
40 {
41 }
42 
44 {
45  delete m_property;
46 }
47 
49 {
50  if(this != &rhs)
51  {
52  delete m_property;
53 
54  m_property = rhs.m_property ? new BandProperty(*rhs.m_property) : 0;
55 
56  m_idx = rhs.m_idx;
57  }
58 
59  return *this;
60 }
61 
62 void te::rst::Band::getValue(unsigned int c, unsigned int r, std::complex<double>& value) const
63 {
64  double vr = 0.0;
65 
66  double vi = 0.0;
67 
68  getValue(c, r, vr);
69 
70  getIValue(c, r, vi);
71 
72  value = std::complex<double>(vr, vi);
73 }
74 
75 void te::rst::Band::setValue(unsigned int c, unsigned int r, const std::complex<double>& value)
76 {
77  setValue(c, r, value.real());
78 
79  setIValue(c, r, value.imag());
80 }
81 
82 std::complex<double> te::rst::Band::getMinValue(bool readall, unsigned int rs, unsigned int cs, unsigned int rf, unsigned int cf) const
83 {
84  std::complex<double> pixel;
85  double min_img = std::numeric_limits<double>::max();
86  double min_real = std::numeric_limits<double>::max();
87  double no_data = getProperty()->m_noDataValue;
88 
89  if ((rf == cf) && (rf == 0))
90  {
91  rf = getRaster()->getNumberOfRows() - 1;
92  cf = getRaster()->getNumberOfColumns() - 1;
93 
94 // read up to 1000 pixels in random positions
95  const unsigned int maxInputPoints = 1000;
96  if (readall == false && (rf * cf) > maxInputPoints)
97  {
98  std::vector<te::gm::Point*> randomPoints = te::rst::GetRandomPointsInRaster(*getRaster(), maxInputPoints);
101  while (pit != pitend)
102  {
103  getValue(pit.getColumn(), pit.getRow(), pixel);
104  ++pit;
105 
106  if(pixel.real() == no_data)
107  continue;
108 
109  if (pixel.real() < min_real)
110  min_real = pixel.real();
111 
112  if (pixel.imag() < min_img)
113  min_img = pixel.imag();
114  }
115 
116  return std::complex<double>(min_real, min_img);
117  }
118  }
119 
120 // read all pixels in range
121  for (unsigned r = rs; r <= rf; r++)
122  for (unsigned c = cs; c <= cf; c++)
123  {
124  getValue(c, r, pixel);
125 
126  if(pixel.real() == no_data)
127  continue;
128 
129  if (pixel.real() < min_real)
130  min_real = pixel.real();
131 
132  if (pixel.imag() < min_img)
133  min_img = pixel.imag();
134  }
135 
136  return std::complex<double>(min_real, min_img);
137 }
138 
139 std::complex<double> te::rst::Band::getMaxValue(bool readall, unsigned int rs, unsigned int cs, unsigned int rf, unsigned int cf) const
140 {
141  std::complex<double> pixel;
142  double max_img = std::numeric_limits<double>::min();
143  double max_real = std::numeric_limits<double>::min();
144  double no_data = getProperty()->m_noDataValue;
145 
146  if ((rf == cf) && (rf == 0))
147  {
148  rf = getRaster()->getNumberOfRows() - 1;
149  cf = getRaster()->getNumberOfColumns() - 1;
150 
151 // read up to 1000 pixels in random positions
152  const unsigned int maxInputPoints = 1000;
153  if (readall == false && (rf * cf) > maxInputPoints)
154  {
155  std::vector<te::gm::Point*> randomPoints = te::rst::GetRandomPointsInRaster(*getRaster(), maxInputPoints);
158  while (pit != pitend)
159  {
160  getValue(pit.getColumn(), pit.getRow(), pixel);
161  ++pit;
162 
163  if(pixel.real() == no_data)
164  continue;
165 
166  if (pixel.real() > max_real)
167  max_real = pixel.real();
168 
169  if (pixel.imag() > max_img)
170  max_img = pixel.imag();
171  }
172 
173  return std::complex<double>(max_real, max_img);
174  }
175  }
176 
177 // read all pixels in range
178  for (unsigned r = rs; r <= rf; r++)
179  for (unsigned c = cs; c <= cf; c++)
180  {
181  getValue(c, r, pixel);
182 
183  if(pixel.real() == no_data)
184  continue;
185 
186  if (pixel.real() > max_real)
187  max_real = pixel.real();
188 
189  if (pixel.imag() > max_img)
190  max_img = pixel.imag();
191  }
192 
193  return std::complex<double>(max_real, max_img);
194 }
195 
196 std::complex<double> te::rst::Band::getStdValue(unsigned int rs, unsigned int cs, unsigned int rf, unsigned int cf) const
197 {
198  if ((rf == cf) && (rf == 0))
199  {
200  rf = getRaster()->getNumberOfRows() - 1;
201 
202  cf = getRaster()->getNumberOfColumns() - 1;
203  }
204 
205  std::complex<double> pixel;
206 
207  std::complex<double> mean = getMeanValue(rs, cs, rf, cf);
208 
209  std::complex<double> diff;
210 
211  std::complex<double> sumDiffs(0.0, 0.0);
212 
213  unsigned n = (rf-rs+1) * (cf-cs+1) - 1;
214 
215  if (n == 0)
216  return std::complex<double> (1.0, 1.0);
217 
218  for (unsigned r = rs; r <= rf; r++)
219  for (unsigned c = cs; c <= cf; c++)
220  {
221  getValue(c, r, pixel);
222 
223  diff = pixel - mean;
224 
225  sumDiffs += diff * diff;
226  }
227 
228  return std::complex<double> (std::sqrt(sumDiffs.real() / n), std::sqrt(sumDiffs.imag() / n));
229 }
230 
231 std::complex<double> te::rst::Band::getMeanValue(unsigned int rs, unsigned int cs, unsigned int rf, unsigned int cf) const
232 {
233  if ((rf == cf) && (rf == 0))
234  {
235  rf = getRaster()->getNumberOfRows() - 1;
236 
237  cf = getRaster()->getNumberOfColumns() - 1;
238  }
239 
240  std::complex<double> pixel;
241 
242  std::complex<double> sumValue(0.0, 0.0);
243 
244  unsigned int n = (rf-rs+1) * (cf-cs+1);
245 
246  for (unsigned r = rs; r <= rf; r++)
247  for (unsigned c = cs; c <= cf; c++)
248  {
249  getValue(c, r, pixel);
250 
251  sumValue += pixel;
252  }
253 
254  if (n == 0)
255  return std::complex<double> (0.0, 0.0);
256 
257  return std::complex<double> (sumValue.real() / n, sumValue.imag() / n);
258 }
259 
260 std::map<double, unsigned> te::rst::Band::getHistogramR(unsigned int rs, unsigned int cs, unsigned int rf, unsigned int cf, unsigned int b) const
261 {
262  if ((rf == cf) && (rf == 0))
263  {
264  rf = getRaster()->getNumberOfRows() - 1;
265 
266  cf = getRaster()->getNumberOfColumns() - 1;
267  }
268 
269  std::map<double, unsigned> hist;
270 
271  double pixel;
272 
273  if (b == 0)
274  for (unsigned r = rs; r <= rf; r++)
275  for (unsigned c = cs; c <= cf; c++)
276  {
277  getValue(c, r, pixel);
278 
279  hist[pixel]++;
280  }
281  else
282  {
283 // find limits to divide into bins
284  double pmin = std::numeric_limits<double>::max();
285  double pmax = -1.0 * std::numeric_limits<double>::max();
286 
287  for (unsigned r = rs; r <= rf; r++)
288  for (unsigned c = cs; c <= cf; c++)
289  {
290  getValue(c, r, pixel);
291 
292  if (pixel > pmax)
293  pmax = pixel;
294 
295  if (pixel < pmin)
296  pmin = pixel;
297  }
298 
299 // create histogram with bins
300  double delta = (pmax * 1.000001 - pmin) / b;
301 
302  std::map<std::size_t, double> binsLocations;
303 
304  std::size_t location = 0;
305 
306  for (double bins = pmin; bins < pmax; bins += delta)
307  {
308  hist[bins] = 0;
309 
310  binsLocations[location++] = bins;
311  }
312 
313 // fill histogram
314  for (unsigned r = rs; r <= rf; r++)
315  for (unsigned c = cs; c <= cf; c++)
316  {
317  getValue(c, r, pixel);
318 
319  location = (std::size_t) ((pixel - pmin) / delta);
320 
321  hist[binsLocations[location]]++;
322  }
323 
324 // removing empty bins from histogram
325  for (double bins = pmin; bins < pmax; bins += delta)
326  if(hist[bins] == 0)
327  hist.erase(bins);
328 
329  }
330 
331  return hist;
332 }
333 
334 std::map<double, unsigned> te::rst::Band::getHistogramI(unsigned int rs, unsigned int cs, unsigned int rf, unsigned int cf, unsigned int b) const
335 {
336  if ((rf == cf) && (rf == 0))
337  {
338  rf = getRaster()->getNumberOfRows() - 1;
339 
340  cf = getRaster()->getNumberOfColumns() - 1;
341  }
342 
343  std::map<double, unsigned> hist;
344 
345  double pixel;
346 
347  if (b == 0)
348  for (unsigned r = rs; r <= rf; r++)
349  for (unsigned c = cs; c <= cf; c++)
350  {
351  getIValue(c, r, pixel);
352 
353  hist[pixel]++;
354  }
355  else
356  {
357 // find limits to divide into bins
358  double pmin = std::numeric_limits<double>::max();
359  double pmax = -1.0 * std::numeric_limits<double>::max();
360 
361  for (unsigned r = rs; r <= rf; r++)
362  for (unsigned c = cs; c <= cf; c++)
363  {
364  getIValue(c, r, pixel);
365 
366  if (pixel > pmax)
367  pmax = pixel;
368 
369  if (pixel < pmin)
370  pmin = pixel;
371  }
372 
373 // create histogram with bins
374  double delta = (pmax * 1.000001 - pmin) / b;
375 
376  std::map<std::size_t, double> binsLocations;
377 
378  std::size_t location = 0;
379 
380  for (double bins = pmin; bins < pmax; bins += delta)
381  {
382  hist[bins] = 0;
383 
384  binsLocations[location++] = bins;
385  }
386 
387 // fill histogram
388  for (unsigned r = rs; r <= rf; r++)
389  for (unsigned c = cs; c <= cf; c++)
390  {
391  getIValue(c, r, pixel);
392 
393  location = (std::size_t) ((pixel - pmin) / delta);
394 
395  hist[binsLocations[location]]++;
396  }
397 
398 // removing empty bins from histogram
399  for (double bins = pmin; bins < pmax; bins += delta)
400  if(hist[bins] == 0)
401  hist.erase(bins);
402 
403  }
404 
405  return hist;
406 }
407 
408 std::complex<double> te::rst::Band::getScaleValue() const
409 {
410  return m_property->m_valuesScale;
411 }
412 
413 void te::rst::Band::setScaleValue(const std::complex<double> s)
414 {
415  m_property->m_valuesScale = s;
416 }
417 
418 std::complex<double> te::rst::Band::getOffsetValue() const
419 {
420  return m_property->m_valuesOffset;
421 }
422 
423 void te::rst::Band::setOffsetValue(const std::complex<double> o)
424 {
425  m_property->m_valuesOffset = o;
426 }
427 
429 {
430  return m_property;
431 }
432 
434 {
435  return m_property;
436 }
437 
438 te::rst::Band& te::rst::Band::callOperator(std::complex<double>(*f)(std::complex<double>, std::complex<double>), te::rst::Band& rhs)
439 {
440  assert(getRaster()->getNumberOfRows() == rhs.getRaster()->getNumberOfRows());
441  assert(getRaster()->getNumberOfColumns() == rhs.getRaster()->getNumberOfColumns());
442  assert(getRaster()->getAccessPolicy() == te::common::RWAccess || getRaster()->getAccessPolicy() == te::common::WAccess);
443 
444  std::complex<double> lhsv, rhsv;
445 
446  std::vector<std::pair<unsigned, unsigned> > rcStPos, rcFPos;
447 
448  unsigned last_y;
449  unsigned last_x;
450  for (unsigned x = 0; x < (unsigned) getProperty()->m_nblocksx; x++)
451  {
452  for (unsigned y = 0; y < (unsigned) getProperty()->m_nblocksy; y++)
453  {
454  rcStPos.push_back(std::pair<unsigned, unsigned> (y * getProperty()->m_blkh, x * getProperty()->m_blkw));
455  last_y = (y + 1) * getProperty()->m_blkh;
456  last_x = (x + 1) * getProperty()->m_blkw;
457  if (last_y > getRaster()->getNumberOfRows())
458  last_y = getRaster()->getNumberOfRows();
459  if (last_x > getRaster()->getNumberOfColumns())
460  last_x = getRaster()->getNumberOfColumns();
461  rcFPos.push_back(std::pair<unsigned, unsigned> (last_y, last_x));
462  }
463  }
464 
465 // rasters without no data values
466  if (getProperty()->m_noDataValue == std::numeric_limits<double>::max())
467  {
468  for (unsigned i = 0; i < rcStPos.size(); i++)
469  {
470  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
471  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
472  {
473  getValue(c, r, lhsv);
474  rhs.getValue(c, r, rhsv);
475 
476  lhsv = f(lhsv, rhsv);
477  setValue(c, r, lhsv);
478  }
479  }
480  }
481 // rasters with no data values
482  else
483  {
484  for (unsigned i = 0; i < rcStPos.size(); i++)
485  {
486  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
487  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
488  {
489 // lhs data
490  getValue(c, r, lhsv);
491  if (lhsv.real() == getProperty()->m_noDataValue)
492  continue;
493 
494 // rhs data
495  rhs.getValue(c, r, rhsv);
496  if (rhsv.real() == rhs.getProperty()->m_noDataValue)
497  continue;
498 
499  lhsv = f(lhsv, rhsv);
500  setValue(c, r, lhsv);
501  }
502  }
503  }
504 
505  return *this;
506 }
507 
508 te::rst::Band& te::rst::Band::callOperator(std::complex<double>(*f)(std::complex<double>, std::complex<double>), std::complex<double>& cvalue)
509 {
510  assert(getRaster()->getAccessPolicy() == te::common::RWAccess || getRaster()->getAccessPolicy() == te::common::WAccess);
511 
512  std::complex<double> lhsv;
513 
514  std::vector<std::pair<unsigned, unsigned> > rcStPos, rcFPos;
515 
516  unsigned last_y;
517  unsigned last_x;
518  for (unsigned x = 0; x < (unsigned) getProperty()->m_nblocksx; x++)
519  {
520  for (unsigned y = 0; y < (unsigned) getProperty()->m_nblocksy; y++)
521  {
522  rcStPos.push_back(std::pair<unsigned, unsigned> (y * getProperty()->m_blkh, x * getProperty()->m_blkw));
523  last_y = (y + 1) * getProperty()->m_blkh;
524  last_x = (x + 1) * getProperty()->m_blkw;
525  if (last_y > getRaster()->getNumberOfRows())
526  last_y = getRaster()->getNumberOfRows();
527  if (last_x > getRaster()->getNumberOfColumns())
528  last_x = getRaster()->getNumberOfColumns();
529  rcFPos.push_back(std::pair<unsigned, unsigned> (last_y, last_x));
530  }
531  }
532 
533 // rasters without no data values
534  if (getProperty()->m_noDataValue == std::numeric_limits<double>::max())
535  {
536  for (unsigned i = 0; i < rcStPos.size(); i++)
537  {
538  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
539  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
540  {
541  getValue(c, r, lhsv);
542 
543  lhsv = f(lhsv, cvalue);
544  setValue(c, r, lhsv);
545  }
546  }
547  }
548 // rasters with no data values
549  else
550  {
551  for (unsigned i = 0; i < rcStPos.size(); i++)
552  {
553  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
554  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
555  {
556 // lhs data
557  getValue(c, r, lhsv);
558  if (lhsv.real() == getProperty()->m_noDataValue)
559  continue;
560 
561  lhsv = f(lhsv, cvalue);
562  setValue(c, r, lhsv);
563  }
564  }
565  }
566 
567  return *this;
568 }
569 
570 std::complex<double> plus(std::complex<double> lhs, std::complex<double> rhs)
571 {
572  return lhs + rhs;
573 }
574 
575 std::complex<double> minus(std::complex<double> lhs, std::complex<double> rhs)
576 {
577  return lhs - rhs;
578 }
579 
580 std::complex<double> times(std::complex<double> lhs, std::complex<double> rhs)
581 {
582  return lhs * rhs;
583 }
584 
585 std::complex<double> divide(std::complex<double> lhs, std::complex<double> rhs)
586 {
587  return lhs / rhs;
588 }
589 
591 {
592  return callOperator(plus, rhs);
593 }
594 
595 te::rst::Band& te::rst::Band::operator+=(std::complex<double>& cvalue)
596 {
597  return callOperator(plus, cvalue);
598 }
599 
601 {
602  return callOperator(minus, rhs);
603 }
604 
605 te::rst::Band& te::rst::Band::operator-=(std::complex<double>& cvalue)
606 {
607  return callOperator(minus, cvalue);
608 }
609 
610 te::rst::Band& te::rst::Band::operator*=(std::complex<double>& cvalue)
611 {
612  return callOperator(times, cvalue);
613 }
614 
616 {
617  return callOperator(times, rhs);
618 }
619 
621 {
622  return callOperator(divide, rhs);
623 }
624 
625 te::rst::Band& te::rst::Band::operator/=(std::complex<double>& cvalue)
626 {
627  return callOperator(divide, cvalue);
628 }
629 
631 {
632  int blkw = m_property->m_blkw;
633 
634  int blkh = m_property->m_blkh;
635 
636  int pxlsize = GetPixelSize(m_property->getType());
637 
638  int blksize = blkw * blkh * pxlsize;
639 
640  return blksize;
641 }
642 
644  : m_property(0),
645  m_idx(rhs.m_idx)
646 {
647  m_property = rhs.m_property ? new BandProperty(*rhs.m_property) : 0;
648 }
649 
Band(BandProperty *p, std::size_t idx)
Constructor.
Definition: Band.cpp:37
It describes one band (or dimension) of a raster.
virtual void getValue(unsigned int c, unsigned int r, double &value) const =0
Returns the cell attribute value.
std::complex< double > getOffsetValue() const
It returns the offset values (real and imaginary) to be applied to the band.
Definition: Band.cpp:418
A raster band description.
Definition: BandProperty.h:61
std::complex< double > times(std::complex< double > lhs, std::complex< double > rhs)
Definition: Band.cpp:580
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
Definition: Raster.cpp:213
virtual Band & operator*=(Band &rhs)
It returns the band product (pixel by pixel).
Definition: Band.cpp:615
virtual Band & operator=(const Band &rhs)
Assignment operator.
Definition: Band.cpp:48
std::complex< double > divide(std::complex< double > lhs, std::complex< double > rhs)
Definition: Band.cpp:585
unsigned int getColumn() const
Returns the current column in iterator.
static PointSetIterator end(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to after the end of the iterator.
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits::max().
Definition: BandProperty.h:136
void setScaleValue(const std::complex< double > s)
Sets the scale values (real and imaginary) to be applied to the band.
Definition: Band.cpp:413
void setOffsetValue(const std::complex< double > o)
Sets the offset values (real and imaginary) to be applied to the band.
Definition: Band.cpp:423
virtual std::map< double, unsigned > getHistogramR(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0, unsigned int b=0) const
It computes and returns the histogram occurring values (real part) in a window of the band...
Definition: Band.cpp:260
This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a...
virtual Band & operator+=(Band &rhs)
It returns the band sum (pixel by pixel).
Definition: Band.cpp:590
Band & callOperator(std::complex< double >(*f)(std::complex< double >, std::complex< double >), Band &rhs)
It calls a parameter function f to apply in all pixels from two bands, e.g. pixel = f(lhs...
Definition: Band.cpp:438
std::complex< double > plus(std::complex< double > lhs, std::complex< double > rhs)
Definition: Band.cpp:570
virtual std::map< double, unsigned > getHistogramI(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0, unsigned int b=0) const
It computes and returns the histogram occurring values (imaginary part) in a window of the band...
Definition: Band.cpp:334
virtual std::complex< double > getMaxValue(bool readall=false, unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the maximum occurring value in a window of the band.
Definition: Band.cpp:139
virtual std::complex< double > getStdValue(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the standard deviation of the occurring values in a window of the band...
Definition: Band.cpp:196
unsigned int getNumberOfRows() const
Returns the raster number of rows.
Definition: Raster.cpp:208
BandProperty * getProperty()
Returns the band property.
Definition: Band.cpp:428
Utility functions for the raster module.
virtual Raster * getRaster() const =0
Returns the associated raster.
virtual Band & operator-=(Band &rhs)
It returns the band subtraction (pixel by pixel).
Definition: Band.cpp:600
It gives access to values in one band (dimension) of a raster.
A raster band description.
Definition: Band.h:63
std::complex< double > getScaleValue() const
It returns the scale values (real and imaginary) to be applied to the band.
Definition: Band.cpp:408
TERASTEREXPORT int GetPixelSize(int datatype)
Returns the byte size of a given datatype.
Definition: Utils.cpp:80
std::complex< double > minus(std::complex< double > lhs, std::complex< double > rhs)
Definition: Band.cpp:575
virtual void setValue(unsigned int c, unsigned int r, const double value)=0
Sets the cell attribute value.
virtual Band & operator/=(Band &rhs)
It returns the band division (pixel by pixel).
Definition: Band.cpp:620
virtual std::complex< double > getMinValue(bool readall=false, unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the minimum occurring value in a window of the band.
Definition: Band.cpp:82
virtual std::complex< double > getMeanValue(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the mean of the occurring values in a window of the band. ...
Definition: Band.cpp:231
TERASTEREXPORT std::vector< te::gm::Point * > GetRandomPointsInRaster(const te::rst::Raster &inputRaster, unsigned int numberOfPoints=1000)
Creates a vector of random positions (points) inside the raster.
Definition: Utils.cpp:485
std::size_t m_idx
The band index.
Definition: Band.h:475
virtual int getBlockSize() const
It returns the number of bytes ocuppied by a data block.
Definition: Band.cpp:630
unsigned int getRow() const
Returns the current row in iterator.
virtual ~Band()
Virtual destructor.
Definition: Band.cpp:43
static PointSetIterator begin(const te::rst::Raster *r, const std::vector< te::gm::Point * > p)
Returns an iterator referring to the first value of the band.
BandProperty * m_property
The band information.
Definition: Band.h:474