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  if (pixel == m_property->m_noDataValue)
280  continue;
281 
282  hist[pixel]++;
283  }
284  else
285  {
286 // find limits to divide into bins
287  double pmin = std::numeric_limits<double>::max();
288  double pmax = -1.0 * std::numeric_limits<double>::max();
289 
290  for (unsigned r = rs; r <= rf; r++)
291  for (unsigned c = cs; c <= cf; c++)
292  {
293  getValue(c, r, pixel);
294 
295  if (pixel == m_property->m_noDataValue)
296  continue;
297 
298  if (pixel > pmax)
299  pmax = pixel;
300 
301  if (pixel < pmin)
302  pmin = pixel;
303  }
304 
305 // create histogram with bins
306  double delta = (pmax * 1.000001 - pmin) / b;
307 
308  std::map<std::size_t, double> binsLocations;
309 
310  std::size_t location = 0;
311 
312  for (double bins = pmin; bins < pmax; bins += delta)
313  {
314  hist[bins] = 0;
315 
316  binsLocations[location++] = bins;
317  }
318 
319 // fill histogram
320  for (unsigned r = rs; r <= rf; r++)
321  for (unsigned c = cs; c <= cf; c++)
322  {
323  getValue(c, r, pixel);
324 
325  if (pixel == m_property->m_noDataValue)
326  continue;
327 
328  location = (std::size_t) ((pixel - pmin) / delta);
329 
330  hist[binsLocations[location]]++;
331  }
332 
333 // removing empty bins from histogram
334  for (double bins = pmin; bins < pmax; bins += delta)
335  if(hist[bins] == 0)
336  hist.erase(bins);
337 
338  }
339 
340  return hist;
341 }
342 
343 std::map<double, unsigned> te::rst::Band::getHistogramI(unsigned int rs, unsigned int cs, unsigned int rf, unsigned int cf, unsigned int b) const
344 {
345  if ((rf == cf) && (rf == 0))
346  {
347  rf = getRaster()->getNumberOfRows() - 1;
348 
349  cf = getRaster()->getNumberOfColumns() - 1;
350  }
351 
352  std::map<double, unsigned> hist;
353 
354  double pixel;
355 
356  if (b == 0)
357  for (unsigned r = rs; r <= rf; r++)
358  for (unsigned c = cs; c <= cf; c++)
359  {
360  getIValue(c, r, pixel);
361 
362  hist[pixel]++;
363  }
364  else
365  {
366 // find limits to divide into bins
367  double pmin = std::numeric_limits<double>::max();
368  double pmax = -1.0 * std::numeric_limits<double>::max();
369 
370  for (unsigned r = rs; r <= rf; r++)
371  for (unsigned c = cs; c <= cf; c++)
372  {
373  getIValue(c, r, pixel);
374 
375  if (pixel > pmax)
376  pmax = pixel;
377 
378  if (pixel < pmin)
379  pmin = pixel;
380  }
381 
382 // create histogram with bins
383  double delta = (pmax * 1.000001 - pmin) / b;
384 
385  std::map<std::size_t, double> binsLocations;
386 
387  std::size_t location = 0;
388 
389  for (double bins = pmin; bins < pmax; bins += delta)
390  {
391  hist[bins] = 0;
392 
393  binsLocations[location++] = bins;
394  }
395 
396 // fill histogram
397  for (unsigned r = rs; r <= rf; r++)
398  for (unsigned c = cs; c <= cf; c++)
399  {
400  getIValue(c, r, pixel);
401 
402  location = (std::size_t) ((pixel - pmin) / delta);
403 
404  hist[binsLocations[location]]++;
405  }
406 
407 // removing empty bins from histogram
408  for (double bins = pmin; bins < pmax; bins += delta)
409  if(hist[bins] == 0)
410  hist.erase(bins);
411 
412  }
413 
414  return hist;
415 }
416 
417 std::complex<double> te::rst::Band::getScaleValue() const
418 {
419  return m_property->m_valuesScale;
420 }
421 
422 void te::rst::Band::setScaleValue(const std::complex<double> s)
423 {
424  m_property->m_valuesScale = s;
425 }
426 
427 std::complex<double> te::rst::Band::getOffsetValue() const
428 {
429  return m_property->m_valuesOffset;
430 }
431 
432 void te::rst::Band::setOffsetValue(const std::complex<double> o)
433 {
434  m_property->m_valuesOffset = o;
435 }
436 
438 {
439  return m_property;
440 }
441 
443 {
444  return m_property;
445 }
446 
447 te::rst::Band& te::rst::Band::callOperator(std::complex<double>(*f)(std::complex<double>, std::complex<double>), te::rst::Band& rhs)
448 {
449  assert(getRaster()->getNumberOfRows() == rhs.getRaster()->getNumberOfRows());
450  assert(getRaster()->getNumberOfColumns() == rhs.getRaster()->getNumberOfColumns());
451  assert(getRaster()->getAccessPolicy() == te::common::RWAccess || getRaster()->getAccessPolicy() == te::common::WAccess);
452 
453  std::complex<double> lhsv, rhsv;
454 
455  std::vector<std::pair<unsigned, unsigned> > rcStPos, rcFPos;
456 
457  unsigned last_y;
458  unsigned last_x;
459  for (unsigned x = 0; x < (unsigned) getProperty()->m_nblocksx; x++)
460  {
461  for (unsigned y = 0; y < (unsigned) getProperty()->m_nblocksy; y++)
462  {
463  rcStPos.push_back(std::pair<unsigned, unsigned> (y * getProperty()->m_blkh, x * getProperty()->m_blkw));
464  last_y = (y + 1) * getProperty()->m_blkh;
465  last_x = (x + 1) * getProperty()->m_blkw;
466  if (last_y > getRaster()->getNumberOfRows())
467  last_y = getRaster()->getNumberOfRows();
468  if (last_x > getRaster()->getNumberOfColumns())
469  last_x = getRaster()->getNumberOfColumns();
470  rcFPos.push_back(std::pair<unsigned, unsigned> (last_y, last_x));
471  }
472  }
473 
474 // rasters without no data values
475  if (getProperty()->m_noDataValue == std::numeric_limits<double>::max())
476  {
477  for (unsigned i = 0; i < rcStPos.size(); i++)
478  {
479  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
480  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
481  {
482  getValue(c, r, lhsv);
483  rhs.getValue(c, r, rhsv);
484 
485  lhsv = f(lhsv, rhsv);
486  setValue(c, r, lhsv);
487  }
488  }
489  }
490 // rasters with no data values
491  else
492  {
493  for (unsigned i = 0; i < rcStPos.size(); i++)
494  {
495  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
496  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
497  {
498 // lhs data
499  getValue(c, r, lhsv);
500  if (lhsv.real() == getProperty()->m_noDataValue)
501  continue;
502 
503 // rhs data
504  rhs.getValue(c, r, rhsv);
505  if (rhsv.real() == rhs.getProperty()->m_noDataValue)
506  continue;
507 
508  lhsv = f(lhsv, rhsv);
509  setValue(c, r, lhsv);
510  }
511  }
512  }
513 
514  return *this;
515 }
516 
517 te::rst::Band& te::rst::Band::callOperator(std::complex<double>(*f)(std::complex<double>, std::complex<double>), std::complex<double>& cvalue)
518 {
519  assert(getRaster()->getAccessPolicy() == te::common::RWAccess || getRaster()->getAccessPolicy() == te::common::WAccess);
520 
521  std::complex<double> lhsv;
522 
523  std::vector<std::pair<unsigned, unsigned> > rcStPos, rcFPos;
524 
525  unsigned last_y;
526  unsigned last_x;
527  for (unsigned x = 0; x < (unsigned) getProperty()->m_nblocksx; x++)
528  {
529  for (unsigned y = 0; y < (unsigned) getProperty()->m_nblocksy; y++)
530  {
531  rcStPos.push_back(std::pair<unsigned, unsigned> (y * getProperty()->m_blkh, x * getProperty()->m_blkw));
532  last_y = (y + 1) * getProperty()->m_blkh;
533  last_x = (x + 1) * getProperty()->m_blkw;
534  if (last_y > getRaster()->getNumberOfRows())
535  last_y = getRaster()->getNumberOfRows();
536  if (last_x > getRaster()->getNumberOfColumns())
537  last_x = getRaster()->getNumberOfColumns();
538  rcFPos.push_back(std::pair<unsigned, unsigned> (last_y, last_x));
539  }
540  }
541 
542 // rasters without no data values
543  if (getProperty()->m_noDataValue == std::numeric_limits<double>::max())
544  {
545  for (unsigned i = 0; i < rcStPos.size(); i++)
546  {
547  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
548  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
549  {
550  getValue(c, r, lhsv);
551 
552  lhsv = f(lhsv, cvalue);
553  setValue(c, r, lhsv);
554  }
555  }
556  }
557 // rasters with no data values
558  else
559  {
560  for (unsigned i = 0; i < rcStPos.size(); i++)
561  {
562  for (unsigned r = rcStPos[i].first; r < rcFPos[i].first; r++)
563  for (unsigned c = rcStPos[i].second; c < rcFPos[i].second; c++)
564  {
565 // lhs data
566  getValue(c, r, lhsv);
567  if (lhsv.real() == getProperty()->m_noDataValue)
568  continue;
569 
570  lhsv = f(lhsv, cvalue);
571  setValue(c, r, lhsv);
572  }
573  }
574  }
575 
576  return *this;
577 }
578 
579 std::complex<double> plus(std::complex<double> lhs, std::complex<double> rhs)
580 {
581  return lhs + rhs;
582 }
583 
584 std::complex<double> minus(std::complex<double> lhs, std::complex<double> rhs)
585 {
586  return lhs - rhs;
587 }
588 
589 std::complex<double> times(std::complex<double> lhs, std::complex<double> rhs)
590 {
591  return lhs * rhs;
592 }
593 
594 std::complex<double> divide(std::complex<double> lhs, std::complex<double> rhs)
595 {
596  return lhs / rhs;
597 }
598 
600 {
601  return callOperator(plus, rhs);
602 }
603 
604 te::rst::Band& te::rst::Band::operator+=(std::complex<double>& cvalue)
605 {
606  return callOperator(plus, cvalue);
607 }
608 
610 {
611  return callOperator(minus, rhs);
612 }
613 
614 te::rst::Band& te::rst::Band::operator-=(std::complex<double>& cvalue)
615 {
616  return callOperator(minus, cvalue);
617 }
618 
619 te::rst::Band& te::rst::Band::operator*=(std::complex<double>& cvalue)
620 {
621  return callOperator(times, cvalue);
622 }
623 
625 {
626  return callOperator(times, rhs);
627 }
628 
630 {
631  return callOperator(divide, rhs);
632 }
633 
634 te::rst::Band& te::rst::Band::operator/=(std::complex<double>& cvalue)
635 {
636  return callOperator(divide, cvalue);
637 }
638 
640 {
641  int blkw = m_property->m_blkw;
642 
643  int blkh = m_property->m_blkh;
644 
645  int pxlsize = GetPixelSize(m_property->getType());
646 
647  int blksize = blkw * blkh * pxlsize;
648 
649  return blksize;
650 }
651 
653  : m_property(0),
654  m_idx(rhs.m_idx)
655 {
656  m_property = rhs.m_property ? new BandProperty(*rhs.m_property) : 0;
657 }
658 
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:427
A raster band description.
Definition: BandProperty.h:61
std::complex< double > times(std::complex< double > lhs, std::complex< double > rhs)
Definition: Band.cpp:589
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:624
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:594
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:422
void setOffsetValue(const std::complex< double > o)
Sets the offset values (real and imaginary) to be applied to the band.
Definition: Band.cpp:432
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:599
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:447
std::complex< double > plus(std::complex< double > lhs, std::complex< double > rhs)
Definition: Band.cpp:579
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:343
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:437
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:609
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:417
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:584
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:629
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:639
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