src/terralib/gdal/Raster.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/gdal/Raster.cpp
22 
23  \brief This is a class that represents a GDAL Raster.
24  */
25 
26 // TerraLib
27 #include "../common/STLUtils.h"
28 #include "../common/StringUtils.h"
29 #include "../core/translator/Translator.h"
30 #include "../datatype/Enums.h"
31 #include "../datatype/SimpleData.h"
32 #include "../geometry/Coord2D.h"
33 #include "../geometry/Envelope.h"
34 #include "../raster/Grid.h"
35 #include "../raster/RasterProperty.h"
36 #include "../raster/RasterFactory.h"
37 #include "../raster/Utils.h"
38 #include "../raster/Reprojection.h"
39 #include "../srs/Converter.h"
40 #include "Band.h"
41 #include "Exception.h"
42 #include "Raster.h"
43 #include "Utils.h"
44 
45 
46 // STL
47 #include <cassert>
48 #include <limits>
49 #include <stdint.h>
50 #include <map>
51 
52 // GDAL
53 #include <ogr_spatialref.h>
54 
55 // Boost
56 #include <boost/lexical_cast.hpp>
57 #include <boost/scoped_array.hpp>
58 
60  : te::rst::Raster(nullptr),
61  m_gdataset(nullptr),
62  m_deleter( nullptr )
63 {
64 }
65 
67  : te::rst::Raster(nullptr, p),
68  m_gdataset(nullptr),
69  m_deleter( nullptr )
70 {
71  GDALAllRegister();
72 
73  m_myURI = rinfo;
74 
78 
80 
81  if(m_gdataset == nullptr)
82  throw Exception(TE_TR("Data file can not be accessed."));
83 
85 
86  GetBands(this, m_bands);
87 }
88 
90  const std::vector<te::rst::BandProperty*>& bprops,
91  const std::map<std::string, std::string>& optParams,
93  : te::rst::Raster(grid, p),
94  m_deleter( nullptr )
95 {
96  create(grid, bprops, optParams, nullptr, nullptr);
97 }
98 
99 // te::gdal::Raster::Raster(GDALDataset* gdataset, te::common::AccessPolicy p)
100 // : te::rst::Raster(0, p),
101 // m_gdataset(gdataset)
102 // {
103 // m_grid = GetGrid(m_gdataset);
104 //
105 // GetBands(this, m_bands);
106 //
107 // m_name = m_gdataset->GetDescription();
108 // }
109 
111  : te::rst::Raster(rhs),
112  m_gdataset(nullptr),
113  m_deleter( rhs.m_deleter ),
114  m_myURI( rhs.m_myURI )
115 {
116  if(rhs.m_gdataset)
117  {
121 
123 
124  if(m_gdataset == nullptr)
125  throw Exception(TE_TR("Data file can not be accessed."));
126 
127  if( getGrid() == nullptr )
128  {
130  }
131 
132  GetBands(this, m_bands);
133  }
134 }
135 
136 te::gdal::Raster::Raster( const unsigned int multiResolutionLevel,
137  const std::string& uRI, const te::common::AccessPolicy& policy )
138  : te::rst::Raster( nullptr, policy ),
139  m_deleter( nullptr ),
140  m_myURI( uRI )
141 {
142  GDALAllRegister();
143 
145  ( IsSubDataSet( m_myURI ) || ( policy & te::common::WAccess ) ) ?
148 
150 
151  if(m_gdataset == nullptr)
152  throw Exception(TE_TR("Data file can not be accessed."));
153 
154  m_grid = GetGrid(m_gdataset, static_cast<int>(multiResolutionLevel));
155 
156  GetBands(this, static_cast<int>(multiResolutionLevel), m_bands );
157 }
158 
160 {
162 
163  if (m_gdataset)
164  {
165  std::string driverName = GetDriverName(m_gdataset->GetDescription());
166 
167  if ((driverName == "PNG" || driverName == "JPEG") &&
169  {
170  char** papszOptions = nullptr;
171 
172  GDALDriver* driverPtr = GetGDALDriverManager()->GetDriverByName(driverName.c_str());
173 
174  GDALDataset* poDataset = driverPtr->CreateCopy(m_gdataset->GetDescription(),
175  m_gdataset, 0, papszOptions,
176  nullptr, nullptr);
177 
178  GDALClose(poDataset);
179  }
180 
181  GDALClose(m_gdataset);
182  }
183 
184  if(m_deleter)
185  {
186  // deleting who?
187  m_deleter = nullptr;
188  }
189 }
190 
191 void te::gdal::Raster::open(const std::map<std::string, std::string>& rinfo, te::common::AccessPolicy p)
192 {
193  std::map<std::string, std::string>::const_iterator it = rinfo.find("URI");
194 
195 // if URI is not specified, let's look for SOURCE
196  if(it == rinfo.end())
197  {
198  it = rinfo.find("SOURCE");
199 
200  if(it == rinfo.end())
201  throw Exception(TE_TR("At least the URI or SOURCE parameter must be informed!"));
202  }
203 
204  m_myURI = it->second;
205 
209 
210  m_gdataset = GetRasterHandle(it->second, p);
211 
212  if(m_gdataset == nullptr)
213  throw Exception(TE_TR("Data file can not be accessed."));
214 
216 
217  m_policy = p;
218 
219  GetBands(this, m_bands);
220 
221  m_name = m_gdataset->GetDescription();
222 }
223 
224 std::map<std::string, std::string> te::gdal::Raster::getInfo() const
225 {
226  std::map<std::string, std::string> info;
227 
228  info["URI"] = m_myURI;
229 
230  return info;
231 }
232 
234 {
235  return m_bands.size();
236 }
237 
238 int te::gdal::Raster::getBandDataType(std::size_t i) const
239 {
240  assert(i < m_bands.size());
241 
242  return m_bands[i]->getProperty()->getType();
243 }
244 
245 const te::rst::Band* te::gdal::Raster::getBand(std::size_t i) const
246 {
247  assert(i < m_bands.size());
248 
249  return m_bands[i];
250 }
251 
253 {
254  assert(i < m_bands.size());
255 
256  return m_bands[i];
257 }
258 
259 const te::rst::Band& te::gdal::Raster::operator[](std::size_t i) const
260 {
261  assert(i < m_bands.size());
262 
263  return *m_bands[i];
264 }
265 
267 {
268  assert(i < m_bands.size());
269 
270  return *m_bands[i];
271 }
272 
274 {
275  return m_gdataset;
276 }
277 
279 {
280  return new Raster(*this);
281 }
282 
284 {
286 
287  for (std::size_t b = 0; b < rhs.getNumberOfBands(); b++)
288  static_cast<te::gdal::Band*>(m_bands[b])->operator=(*static_cast<te::gdal::Band*>(rhs.m_bands[b]));
289 
290  return *this;
291 }
292 
293 te::rst::Raster* te::gdal::Raster::resample(int method, int scale, const std::map<std::string, std::string>& rinfo) const
294 {
295  assert(scale != 0);
296 
297  if (!(scale < 0 && method == 3))
298  return te::rst::Raster::resample(method, scale, rinfo);
299 
300 // create output parameters and raster
301  te::rst::Grid* grid = new te::rst::Grid(*getResampledGrid(scale));
302 
303  std::vector<te::rst::BandProperty*> bands;
304 
305  for (std::size_t b = 0; b < getNumberOfBands(); b++)
306  bands.push_back(new te::rst::BandProperty(*(getBand(b)->getProperty())));
307 
308  te::rst::Raster* rout = te::rst::RasterFactory::make(grid, bands, rinfo);
309 
310  int overviewScale[1] = { -scale };
311 
312  GDALDataset* inds = getGDALDataset();
313 
314  GDALDataset* outds = static_cast<te::gdal::Raster*>(rout)->getGDALDataset();
315 
316  int overviewIndex = -1;
317  for (int ov = 0; ov < inds->GetRasterBand(1)->GetOverviewCount(); ov++)
318  if (inds->GetRasterBand(1)->GetOverview(ov)->GetXSize() == outds->GetRasterBand(1)->GetXSize())
319  {
320  overviewIndex = ov;
321  ov = inds->GetRasterBand(1)->GetOverviewCount();
322  }
323 
324  if (overviewIndex == -1)
325  {
326  inds->BuildOverviews("CUBIC", 1, overviewScale, 0, nullptr, GDALDummyProgress, nullptr);
327 
328  overviewIndex = inds->GetRasterBand(1)->GetOverviewCount() - 1;
329  }
330 
331  GByte* buffer = reinterpret_cast<GByte*>(malloc(static_cast<size_t>(outds->GetRasterXSize() * outds->GetRasterYSize()) * sizeof(GByte*)));
332 
333  double geoT[6];
334  outds->GetGeoTransform(geoT);
335  outds->SetGeoTransform(geoT);
336 
337  for (int b = 0; b < inds->GetRasterCount(); b++)
338  {
339  GDALRasterBand* outband = outds->GetRasterBand(b + 1);
340 
341  GDALRasterBand* inband = inds->GetRasterBand(b + 1)->GetOverview(overviewIndex);
342 
343  CPLErr error = inband->RasterIO(GF_Read, 0, 0, inband->GetXSize(), inband->GetYSize(),
344  buffer, inband->GetXSize(), inband->GetYSize(), GDT_Byte, 0, 0);
345 
346  if(error == CE_Failure || error == CE_Fatal)
347  {
348  //TODO There are codes that describes the error. Send a message according to it.
349  }
350 
351  error = outband->RasterIO(GF_Write, 0, 0, inband->GetXSize(), inband->GetYSize(),
352  buffer, inband->GetXSize(), inband->GetYSize(), GDT_Byte, 0, 0);
353 
354  if(error == CE_Failure || error == CE_Fatal)
355  {
356  //TODO There are codes that describes the error. Send a message according to it.
357  }
358  }
359 
360  return rout;
361 }
362 
363 te::rst::Raster* te::gdal::Raster::transform(int srid, double llx, double lly, double urx, double ury, double resx, double resy, const std::map<std::string, std::string>& rinfo, int m) const
364 {
365  std::map<std::string, std::string>::const_iterator it = rinfo.find("USE_TERRALIB_REPROJECTION");
366  const bool sridIsRecognized = te::gdal::RecognizesSRID(static_cast<unsigned int>(srid));
367 
368  if(
369  (
370  (it != rinfo.end())
371  &&
372  (te::common::Convert2UCase(it->second) == "TRUE")
373  )
374  ||
375  ( !sridIsRecognized )
376  )
377  {
378  // Call internal terralib reprojection routines if the user requested it
379  // or the SRID isn't recognized by GDAL
380 
381  std::map<std::string, std::string> irinfo(rinfo);
382  std::map<std::string, std::string>::iterator iit = irinfo.find("USE_TERRALIB_REPROJECTION");
383  irinfo.erase(iit);
384 
385  return te::rst::Reproject(this, srid, llx, lly, urx, ury, resx, resy, irinfo, m);
386  }
387 
388 // otherwise, use GDAL Warp function
389  if (srid == getSRID())
390  return nullptr;
391 
392  unsigned int ncols = getNumberOfColumns();
393  unsigned int nrows = getNumberOfRows();
394 
395  te::gm::Envelope* roi = new te::gm::Envelope(llx, lly, urx, ury);
396  if (!roi->isValid())
397  {
398  delete roi;
399 
400  roi = nullptr;
401  }
402  else
403  {
404  ncols = static_cast<unsigned int>((urx-llx)/getResolutionX())+1;
405 
406  nrows = static_cast<unsigned int>((ury-lly)/getResolutionY())+1;
407  }
408 
409  te::gm::Envelope* env = this->getExtent(srid, roi);
410  delete roi;
411 
412  if (resx == 0 || resy == 0) // maintain the same number of pixels
413  {
414  resx = env->getWidth()/ncols;
415 
416  resy = env->getHeight()/nrows;
417  }
418  else
419  {
420  ncols = static_cast<unsigned int>(env->getWidth()/resx) + 1;
421 
422  nrows = static_cast<unsigned int>(env->getHeight()/resy) + 1;
423  }
424 
425  te::rst::Grid* g = new te::rst::Grid(ncols, nrows, resx, resy, env, srid);
426 
427  // copy the band definitions
428  std::vector<te::rst::BandProperty*> bands;
429  for (unsigned int b=0; b<this->getNumberOfBands(); ++b)
430  {
431  te::rst::BandProperty* bb = new te::rst::BandProperty(*this->getBand(b)->getProperty());
432 
433  bands.push_back(bb);
434  }
435 
436 // create output raster
437  te::rst::Raster* rout = te::rst::RasterFactory::make(g, bands, rinfo);
438 
439  if (te::gdal::ReprojectRaster(this, rout))
440  {
441  delete rout;
442 
444  }
445 
446  delete rout;
447 
448  return nullptr;
449 }
450 
452 {
453  te::gdal::ReprojectRaster(this, outRaster);
454 }
455 
457  const std::vector<te::rst::BandProperty*> bands,
458  const std::map<std::string, std::string>& rinfo,
459  void* h, void (*deleter)(void*))
460 {
461  m_grid = g;
462 
463  m_deleter = deleter;
464 
465 // always assume that a created raster needs to be written
467 
468  if (h)
469  {
470  intptr_t buffaddress = reinterpret_cast<intptr_t>(h);
471 
472  std::string memraster = "MEM:::DATAPOINTER=";
473  memraster += boost::lexical_cast<std::string>(buffaddress);
474  memraster += ",PIXELS=";
476  memraster += ",LINES=";
478  memraster += ",BANDS=";
479  memraster += boost::lexical_cast<std::string>(bands.size());
480  memraster += ",DATATYPE=";
481  memraster += GDALGetDataTypeName(GetGDALDataType(bands[0]->getType()));
482 
483  m_gdataset = GetRasterHandle(memraster, m_policy);
484  }
485  else
486  {
487  std::map<std::string, std::string>::const_iterator it = rinfo.find("URI");
488  if(it == rinfo.end())
489  {
490  it = rinfo.find("SOURCE");
491 
492  if(it == rinfo.end())
493  throw Exception(TE_TR("At least the URI or SOURCE parameter must be informed!"));
494  }
495 
496  m_myURI = it->second;
497 
499 
500  m_gdataset = te::gdal::CreateRaster(g, bands, rinfo);
501 
503 
504  if (!m_gdataset)
505  {
506  delete g;
507  g = nullptr;
508 
509  std::string mess = TE_TR("Raster couldn't be created:");
510  mess += m_name;
511  throw Exception(mess);
512  }
513 
514  GetBands(this, m_bands);
515  }
516 }
517 
518 bool te::gdal::Raster::createMultiResolution( const unsigned int levels,
519  const te::rst::InterpolationMethod interpMethod )
520 {
521  if( m_gdataset == nullptr )
522  {
523  return false;
524  }
525  else
526  {
527  const DataSetsManager::AccessType oldAccessType = m_dsUseCounterPtr->getAccessType();
528 
530  {
531  boost::scoped_array< int > overviewsIndexes( new int[ levels ] );
532  for( unsigned int overViewIdx = 0 ; overViewIdx < levels ; ++overViewIdx )
533  {
534  overviewsIndexes[ overViewIdx ] = static_cast<int>(overViewIdx) + 1;
535  }
536 
537  // Clean old overviews
538 
539  m_gdataset->FlushCache();
540 
541  CPLErr returnValue = m_gdataset->BuildOverviews(
542  GetGDALRessamplingMethod( interpMethod ).c_str(),
543  static_cast<int>(0),
544  nullptr,
545  0,
546  nullptr,
547  nullptr,
548  nullptr );
549 
550  m_gdataset->FlushCache();
551 
552  returnValue = m_gdataset->BuildOverviews(
553  GetGDALRessamplingMethod( interpMethod ).c_str(),
554  static_cast<int>(levels),
555  overviewsIndexes.get(),
556  0,
557  nullptr,
558  nullptr,
559  nullptr );
560 
561  m_gdataset->FlushCache();
562 
563  m_dsUseCounterPtr->changeAccessType( oldAccessType );
564 
565  if( returnValue == CE_Failure )
566  {
567  return false;
568  }
569  else
570  {
571  return true;
572  }
573  }
574  else
575  {
576  return false;
577  }
578  }
579 }
580 
582 {
583  if( m_gdataset == nullptr )
584  {
585  return true;
586  }
587  else
588  {
589  if( m_gdataset->GetRasterCount() > 0 )
590  {
591  if( m_gdataset->GetRasterBand( 1 )->GetOverviewCount() > 0 )
592  {
593  CPLErr returnValue = m_gdataset->BuildOverviews(
595  static_cast<int>(0),
596  nullptr,
597  0,
598  nullptr,
599  nullptr,
600  nullptr );
601 
602  m_gdataset->FlushCache();
603 
604  if( returnValue == CE_Failure )
605  {
606  return false;
607  }
608  else
609  {
610  return true;
611  }
612  }
613  else
614  {
615  return true;
616  }
617  }
618  else
619  {
620  return true;
621  }
622  }
623 }
624 
626 {
627  if( m_gdataset == nullptr )
628  {
629  return 0;
630  }
631  else
632  {
633  if( m_gdataset->GetRasterCount() > 0 )
634  {
635  return static_cast<unsigned int>(m_gdataset->GetRasterBand( 1 )->GetOverviewCount());
636  }
637  else
638  {
639  return 0;
640  }
641  }
642 }
643 
644 te::rst::Raster* te::gdal::Raster::getMultiResLevel( const unsigned int level ) const
645 {
646  if( m_gdataset == nullptr )
647  {
648  return nullptr;
649  }
650  else
651  {
652  if( m_gdataset->GetRasterCount() > 0 )
653  {
654  if( level <= (static_cast<unsigned int>(m_gdataset->GetRasterBand( 1 )->GetOverviewCount())) )
655  {
656  return new Raster( level, m_myURI, m_policy );
657  }
658  else
659  {
660  return nullptr;
661  }
662  }
663  else
664  {
665  return nullptr;
666  }
667  }
668 }
GDALDataset * getGDALDataset() const
Returns the raster GDAL handler.
void open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
Opens a raster.
unsigned int getNumberOfRows() const
Returns the grid number of rows.
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
GDALDataType GetGDALDataType(int tet)
It translates a TerraLib DataType to a GDAL DataType.
Near neighborhood interpolation method.
void GetBands(te::gdal::Raster *rst, std::vector< te::gdal::Band * > &bands)
Gets the list of bands from a GDAL dataset.
A raster band description.
Definition: BandProperty.h:61
This class represents Raster data.
Base exception class for plugin module.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
const te::rst::Band & operator[](std::size_t i) const
Access band in i position.
virtual Raster * resample(int method, unsigned int drow, unsigned int dcolumn, unsigned int height, unsigned int width, unsigned int newheight, unsigned int newwidth, const std::map< std::string, std::string > &rinfo) const
Resample a subset of the raster, given a box.
std::string Convert2UCase(const std::string &value)
It converts a string to upper case.
Definition: StringUtils.h:168
double getWidth() const
It returns the envelope width.
~Raster()
Virtual destructor.
te::rst::Raster * getMultiResLevel(const unsigned int level) const
Returns the required level of a multi-resolution pyramid or NULL if that level does not exists...
Raster & operator=(const Raster &rhs)
te::rst::Raster * resample(int method, int scale, const std::map< std::string, std::string > &rinfo) const
Resample raster.
te::rst::Raster * transform(int srid, double llx, double lly, double urx, double ury, double resx, double resy, const std::map< std::string, std::string > &rinfo, int m=0) const
bool removeMultiResolution()
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
This is a class that represents a GDAL Raster.
#define TE_TR(message)
It marks a string in order to get translated.
Definition: Translator.h:242
InterpolationMethod
Allowed interpolation methods.
GDALDataset * m_gdataset
Gdal data set handler.
te::dt::AbstractData * clone() const
It returns a clone of this object.
std::string GetGDALRessamplingMethod(te::rst::InterpolationMethod interpolationMethod)
It translates a TerraLib interpolation method into a GDAL ressampling method name string...
This class represents raster band description.
std::string m_name
The raster name.
Grid * m_grid
The spatial support for raster data.
Grid * getResampledGrid(int scale) const
Return the raster grid for a specific scale.
AccessPolicy
Supported data access policies (can be used as bitfield).
int b
Definition: TsRtree.cpp:32
GDALDataset * CreateRaster(te::rst::Grid *g, const std::vector< te::rst::BandProperty * > &bands, const std::map< std::string, std::string > &optParams)
Creates a raster data using GDAL.
GDALDataset * GetRasterHandle(std::string strAccessInfo, te::common::AccessPolicy policy=te::common::RAccess)
Get a handle to a raster file.
std::size_t getNumberOfBands() const
Returns the number of bands (dimension of cells attribute values) in the raster.
An Envelope defines a 2D rectangular region.
bool createMultiResolution(const unsigned int levels, const te::rst::InterpolationMethod interpMethod)
Create a sub-sampled multi-resolution pyramid.
An abstract class for raster data strucutures.
std::map< std::string, std::string > getInfo() const
It returns additional information about the raster.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
std::string GetParentDataSetName(const std::string &subDataSetName)
It returns the parent dataset name from a Sub DataSet name.
URI C++ Library.
Definition: Attributes.h:37
std::string m_myURI
This instance URI;.
unsigned int getNumberOfColumns() const
Returns the grid number of columns.
double getResolutionX() const
Returns the raster horizontal (x-axis) resolution.
void(* m_deleter)(void *)
A pointer to a deleter function, if the buffer needs to be deleted by this object.
list bands
Definition: compose.py:2
unsigned int getMultiResLevelsCount() const
Returns the current number of multi-resolution pyramid levels.
te::gm::Polygon * p
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
A raster band description.
Grid * getGrid()
It returns the raster grid.
virtual Raster & operator=(const Raster &rhs)
Assignment operator.
int getBandDataType(std::size_t i) const
Returns the data type in a particular band (or dimension).
std::string GetDriverName(const std::string &dsName)
It returns the GDAL driver name associated to a data source name.
bool IsSubDataSet(const std::string &uri)
Returns true if the given URI is related to a sub-dataset.
bool ReprojectRaster(te::rst::Raster const *const rin, te::rst::Raster *rout)
Reprojects a raster to another SRS.
int getSRID() const
Returns the raster spatial reference system identifier.
TERASTEREXPORT te::rst::Raster * Reproject(te::rst::Raster const *const rin, int srid, const std::map< std::string, std::string > &routinfo, int m=te::rst::NearestNeighbor)
Reprojects a raster to another SRS.
bool RecognizesSRID(unsigned int srid)
It returns true if GDAL recognizes the given SRS id.
static Raster * make()
It creates and returns an empty raster with default raster driver.
GDAL data set use counter.
double getResolutionY() const
Returns the raster vertical (y-axis) resolution.
std::unique_ptr< DataSetUseCounter > m_dsUseCounterPtr
Dataset use counter pointer.
std::vector< Band * > m_bands
The vector of available bands in the raster.
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
Definition: StringUtils.h:56
It gives access to values in one band (dimension) of a raster.
void create(te::rst::Grid *g, const std::vector< te::rst::BandProperty * > bands, const std::map< std::string, std::string > &rinfo, void *h, void(*deleter)(void *))
A rectified grid is the spatial support for raster data.
Definition: raster/Grid.h:68
An exception class for the GDAL module.
TEGDALEXPORT te::rst::Grid * GetGrid(GDALDataset *gds)
Gets the grid definition from a GDAL dataset.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
Definition: BoostUtils.h:55
double getHeight() const
It returns the envelope height.
te::common::AccessPolicy m_policy
The access policy, can be te::common::{NoAccess, RAccess, RWAccess, WAccess}.
bool isValid() const
It tells if the rectangle is valid or not.
Utilitary functions to access GDAL and match some of its concepts to TerraLib concepts.
static Raster * open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
It opens a raster with the given parameters and default raster driver.
const te::rst::Band * getBand(std::size_t i) const
Returns the raster i-th band.