Utils.h
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/Utils.h
22 
23  \brief Utilitary functions to access GDAL and match some of its concepts to TerraLib concepts.
24  */
25 
26 #ifndef __TERRALIB_GDAL_INTERNAL_UTILS_H
27 #define __TERRALIB_GDAL_INTERNAL_UTILS_H
28 
29 // TerraLib
30 #include "../raster/BandProperty.h"
31 #include "../raster/Enums.h"
32 #include "../raster/Raster.h"
33 #include "../core/translator/Translator.h"
34 #include "Config.h"
35 #include "Raster.h"
36 
37 // GDAL
38 #include <gdal_priv.h>
39 #include <cpl_error.h>
40 
41 // STL
42 #include <map>
43 #include <string>
44 #include <vector>
45 #include <set>
46 
47 #include <boost/filesystem.hpp>
48 #include <boost/thread/mutex.hpp>
49 
50 namespace te
51 {
52  namespace gm {class Envelope; class Geometry;}
53 
54  namespace rst {class Grid; class RasterProperty; }
55 
56  namespace core { class URI; }
57 
58  namespace gdal
59  {
60  /*!
61  \brief GDAL driver metadata.
62  */
64  {
65  std::string m_driverName; //!< Driver name (driver description).
66  std::vector< std::string > m_extensions; //!< List of extensions handled by the driver (GDAL_DMD_EXTENSIONS).
67  std::string m_longName; //!< File long name (GDAL_DMD_LONGNAME).
68  bool m_subDatasetsSupport; //!< true if the driver has support for sub-datasets (GDAL_DMD_SUBDATASETS).
69  bool m_isRaster; //!< Capability set by a driver having raster capability (GDAL_DCAP_RASTER).
70  bool m_isVector; //!< Capability set by a driver having vector capability (GDAL_DCAP_VECTOR).
71  bool m_supportCreation; //!< Capability set by a driver having vector capability (GDAL_DCAP_CREATE).
72  };
73 
74  /*!
75  \brief It translates a GDAL DataType to a TerraLib DataType.
76  */
77  inline int GetTeDataType(GDALDataType gt)
78  {
79  switch(gt)
80  {
81  case GDT_Byte : return te::dt::UCHAR_TYPE;
82  case GDT_UInt16 : return te::dt::UINT16_TYPE;
83  case GDT_Int16 : return te::dt::INT16_TYPE;
84  case GDT_UInt32 : return te::dt::UINT32_TYPE;
85  case GDT_Int32 : return te::dt::INT32_TYPE;
86  case GDT_Float32 : return te::dt::FLOAT_TYPE;
87  case GDT_Float64 : return te::dt::DOUBLE_TYPE;
88 
89  case GDT_CInt16 : return te::dt::CINT16_TYPE;
90  case GDT_CInt32 : return te::dt::CINT32_TYPE;
91  case GDT_CFloat32 : return te::dt::CFLOAT_TYPE;
92  case GDT_CFloat64 : return te::dt::CDOUBLE_TYPE;
93 
94  default : return te::dt::UNKNOWN_TYPE;
95  }
96  }
97 
98  /*!
99  \brief It translates a TerraLib DataType to a GDAL DataType.
100  */
101  inline GDALDataType GetGDALDataType(int tet)
102  {
103  switch(tet)
104  {
105  case te::dt::UCHAR_TYPE : return GDT_Byte;
106  case te::dt::CHAR_TYPE : return GDT_Byte;
107  case te::dt::UINT16_TYPE : return GDT_UInt16;
108  case te::dt::INT16_TYPE : return GDT_Int16;
109  case te::dt::UINT32_TYPE : return GDT_UInt32;
110  case te::dt::INT32_TYPE : return GDT_Int32;
111  case te::dt::FLOAT_TYPE : return GDT_Float32;
112  case te::dt::DOUBLE_TYPE : return GDT_Float64;
113 
114  case te::dt::CINT16_TYPE : return GDT_CInt16;
115  case te::dt::CINT32_TYPE : return GDT_CInt32;
116  case te::dt::CFLOAT_TYPE : return GDT_CFloat32;
117  case te::dt::CDOUBLE_TYPE : return GDT_CFloat64;
118 
119  default : return GDT_Unknown;
120  }
121  }
122 
123  /*!
124  \brief It translates a GDAL ColorInterpretation to a TerraLib ColorInterpretation.
125  */
126  inline te::rst::ColorInterp GetTeColorInterpretation(GDALColorInterp gci)
127  {
128  switch(gci)
129  {
130  case GCI_GrayIndex : return te::rst::GrayIdxCInt;
131  case GCI_PaletteIndex : return te::rst::PaletteIdxCInt;
132  case GCI_RedBand : return te::rst::RedCInt;
133  case GCI_GreenBand : return te::rst::GreenCInt;
134  case GCI_BlueBand : return te::rst::BlueCInt;
135  case GCI_AlphaBand : return te::rst::AlphaCInt;
136  case GCI_HueBand : return te::rst::HueCInt;
137  case GCI_SaturationBand : return te::rst::SatCInt;
138  case GCI_LightnessBand : return te::rst::LigCInt;
139  case GCI_CyanBand : return te::rst::CyanCInt;
140  case GCI_MagentaBand : return te::rst::MagentaCInt;
141  case GCI_YellowBand : return te::rst::YellowCInt;
142  case GCI_BlackBand : return te::rst::KeyCInt;
143  case GCI_YCbCr_YBand : return te::rst::YCInt;
144  case GCI_YCbCr_CbBand : return te::rst::CbCInt;
145  case GCI_YCbCr_CrBand : return te::rst::CrCInt;
146  default : return te::rst::UndefCInt;
147  }
148  }
149 
150  /*!
151  \brief It translates a TerraLib ColorInterpretation to a GDAL ColorInterpretation.
152  */
154  {
155  switch(ci)
156  {
157  case te::rst::GrayIdxCInt : return GCI_GrayIndex;
158  case te::rst::PaletteIdxCInt : return GCI_PaletteIndex;
159  case te::rst::RedCInt : return GCI_RedBand;
160  case te::rst::GreenCInt : return GCI_GreenBand;
161  case te::rst::BlueCInt : return GCI_BlueBand;
162  case te::rst::AlphaCInt : return GCI_AlphaBand;
163  case te::rst::HueCInt : return GCI_HueBand;
164  case te::rst::SatCInt : return GCI_SaturationBand;
165  case te::rst::LigCInt : return GCI_LightnessBand;
166  case te::rst::CyanCInt : return GCI_CyanBand;
167  case te::rst::MagentaCInt : return GCI_MagentaBand;
168  case te::rst::YellowCInt : return GCI_YellowBand;
169  case te::rst::KeyCInt : return GCI_BlackBand;
170  case te::rst::YCInt : return GCI_YCbCr_YBand;
171  case te::rst::CbCInt : return GCI_YCbCr_CbBand;
172  case te::rst::CrCInt : return GCI_YCbCr_CrBand;
173  default : return GCI_Undefined;
174  }
175  }
176 
177  /*!
178  \brief It translates a GDAL Pallete Interpretation to a TerraLib Pallete Interpretation.
179  */
181  {
182  switch (gpi)
183  {
184  case GPI_Gray : return te::rst::GrayPalInt;
185  case GPI_RGB : return te::rst::RGBPalInt;
186  case GPI_CMYK : return te::rst::CMYKPalInt;
187  case GPI_HLS : return te::rst::HSLPalInt;
188  default : return te::rst::UndefPalInt;
189  }
190  }
191 
192  /*!
193  \brief It translates a TerraLib interpolation method into a GDAL ressampling method name string.
194  */
195  inline std::string GetGDALRessamplingMethod(te::rst::InterpolationMethod interpolationMethod )
196  {
197  switch(interpolationMethod)
198  {
199  case te::rst::NearestNeighbor : return std::string( "NEAREST" );
200  case te::rst::Bilinear : return std::string( "AVERAGE" );
201  case te::rst::Bicubic : return std::string( "CUBIC" );
202  default : throw Exception(TE_TR("Invalid interpolation method"));
203  }
204  }
205 
206  /*!
207  \brief Gets the grid definition from a GDAL dataset.
208  \param gds A pointer to a GDAL dataset.
209  \return A pointer to the grid definition from a GDAL dataset. Caller takes its ownership.
210  */
211  TEGDALEXPORT te::rst::Grid* GetGrid(GDALDataset* gds);
212 
213  /*!
214  \brief Gets the grid definition from a GDAL dataset.
215  \param gds A pointer to a GDAL dataset.
216  \param multiResLevel Multi resolution level (use -1 to use the original resolution).
217  \return A pointer to the grid definition from a GDAL dataset. Caller takes its ownership.
218  */
219  TEGDALEXPORT te::rst::Grid* GetGrid(GDALDataset* gds, const int multiResLevel );
220 
221  /*!
222  \brief Gets the list of bands definition from a GDAL dataset.
223  \param gds A pointer to a GDAL dataset.
224  \param bprops A reference to a vector to be filled with the bands description extracted from a dataset.
225  \note The caller of this method must take the ownership of the returned properties.
226  */
227  TEGDALEXPORT void GetBandProperties(GDALDataset* gds, std::vector<te::rst::BandProperty*>& bprops);
228 
229  /*!
230  \brief Gets the properties of a single band from a GDAL dataset.
231 
232  \param gband A pointer to a GDAL Raster Band.
233 
234  \param bandIndex The band index (starting from 0).
235 
236  \return A band property.
237 
238  \note The caller of this method must take the ownership of the returned properties.
239  */
240  te::rst::BandProperty* GetBandProperty(GDALRasterBand* gband, const unsigned int bandIndex );
241 
242  /*!
243  \brief Gets the list of bands from a GDAL dataset.
244 
245  \param rst A pointer to the raster.
246  \param bands A reference to a vector to be filled with the bands extracted from a dataset.
247  \note The caller of this method must take the ownership of the returned properties.
248  */
249  void GetBands(te::gdal::Raster* rst, std::vector<te::gdal::Band*>& bands);
250 
251  /*!
252  \brief Gets the list of bands from a GDAL dataset.
253 
254  \param rst A pointer to the raster.
255  \param multiResLevel Multi-resolution pyramid level (value -1 -> overviews disabled).
256  \param bands A reference to a vector to be filled with the bands extracted from a dataset.
257  \note The caller of this method must take the ownership of the returned properties.
258  */
259  bool GetBands(te::gdal::Raster* rst, int multiResLevel, std::vector<te::gdal::Band*>& bands);
260 
261  /*!
262  \brief Gets the complete description from a GDAL dataset.
263  \param strAccessInfo A a string to be used by GDAL to access the raster.
264  \return A pointer to the raster description from a GDAL dataset. Caller takes its ownership.
265  */
266  te::rst::RasterProperty* GetRasterProperty(std::string strAccessInfo);
267 
268  /*!
269  \brief Creates a raster data using GDAL.
270 
271  \param g Raster grid info.
272  \param bands Band info.
273  \param optParams A vector of optional parameters that are valid only for some data formats.
274 
275  \return A pointer to a GDALDataset if it succeeds or a NULL pointer otherwise. Caller is responsible for closing it.
276 
277  \exception Exception It throws an exception if the raster can not be created.
278  */
279  GDALDataset* CreateRaster(te::rst::Grid* g, const std::vector<te::rst::BandProperty*>& bands, const std::map<std::string, std::string>& optParams);
280 
281  /*!
282  \brief Creates a raster data using GDAL.
283  \param name The name of the dataset to create. UTF-8 encoded.
284  \param g Raster grid info.
285  \param bands Band info.
286  \param optParams A vector of optional parameters that are valid only for some data formats.
287 
288  \return A pointer to a GDALDataset if it succeeds or a NULL pointer otherwise. Caller is responsible for closing it.
289 
290  \exception Exception It throws an exception if the raster can not be created.
291  */
292  GDALDataset* CreateRaster(const std::string& name, te::rst::Grid* g, const std::vector<te::rst::BandProperty*>& bands, const std::map<std::string, std::string>& optParams);
293 
294  /*!
295  \brief Gets the extent of a raster data decoded by GDAL.
296  \param strAccessInfo A a string to be used by GDAL to access the raster.
297  \return A pointer to raster extent. Caller takes its ownership.
298  */
299  te::gm::Envelope* GetExtent(std::string strAccessInfo);
300 
301  /*!
302  \brief Get a handle to a raster file.
303  \param filename File name (path included).
304  \param policy The access permission requested.
305  \return A pointer to GDAL dataset if it succeeds or a NULL pointer otherwise.
306  */
307  GDALDataset* GetRasterHandle(std::string strAccessInfo, te::common::AccessPolicy policy = te::common::RAccess);
308 
309  /*!
310  \brief Returns a PostGIS connection string from the URI connection information.
311  The connection string is to be used as a dataset name in GDAL data model. See also http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html.
312  \param connInfo The URI parameters.
313  \return Returns a PostGIS connection string from the set connection information.
314  */
315  std::string MakePGConnectionStr(const te::core::URI& connInfo);
316 
317  /*!
318  \brief Reprojects a raster to another SRS.
319  \param rin The input raster file. Do not pass a null pointer.
320  \param rout The new output raster. Do not pass a null pointer.
321  \return true If the reprojection was done or false otherwise.
322  */
323  bool ReprojectRaster(te::rst::Raster const * const rin, te::rst::Raster* rout);
324 
325  /*!
326  \brief It returns the GDAL driver name associated to a data source name.
327 
328  \param dsName the name of the file that represents the data source.
329 
330  \return the GDAL driver name, or its identifier if succeeds and a null string otherwise.
331  */
332  std::string GetDriverName(const std::string& dsName);
333 
334  /*!
335  \brief It returns a GDAL connection string from the given map.
336 
337  \param connInfo An associative conteiner with data source connection info.
338 
339  \return a GDAL connection string from the given map.
340 
341  \exception Exception It throws an exception if no connection info exists in the input map.
342  */
343  std::string GetGDALConnectionInfo(const std::map<std::string, std::string>& connInfo);
344 
345  /*!
346  \brief It returns the Sub DataSet name from the given name or the same name.
347 
348  \param name The Full SubDataSet string name.
349 
350  \param driverName The driver name.
351 
352  \return The Sub DataSet name from the given name.
353  */
354  std::string GetSubDataSetName(const std::string& name, const std::string& driverName);
355 
356  /*!
357  \brief It returns true if GDAL recognizes the given SRS id.
358 
359  \param srid The SRS identifier.
360 
361  \return true if GDAL recognizes the given SRS id or false otherwise.
362  */
363  bool RecognizesSRID(unsigned int srid);
364 
365  /*!
366  \brief Vectorizes a given raster band, using GDALPolygonize function.
367 
368  \param band The band to vectorize.
369  \param geometries A reference to a vector of geometries. Will be filled with geometries found in band.
370  */
371  TEGDALEXPORT void Vectorize(GDALRasterBand* band, std::vector<te::gm::Geometry*>& geometries);
372 
373  /*!
374  \brief Rasterizes a given vector of geometries, using GDALRasterizeGeometries function.
375 
376  \param geometries A vector of geometries to be rasterized.
377  \param outraster A reference to the GDAL dataset where the rasterized geometries will be drawn.
378  */
379  TEGDALEXPORT void Rasterize(std::vector<te::gm::Geometry*> geometries, GDALDataset* outraster);
380 
381  /*!
382  \brief Returns true if the given URI is related to a sub-dataset.
383  \param uri The given URI.
384  \return true if the given URI is related to a sub-dataset.
385  */
386  bool IsSubDataSet( const std::string& uri );
387 
388  /*!
389  \brief It returns the parent dataset name from a Sub DataSet name.
390  \param subDataSetName The Full SubDataSet string name.
391  \return the parent dataset name from a Sub DataSet name.
392  \note If the given name does not refers to a sub-dataset it will be returned.
393  */
394  std::string GetParentDataSetName(const std::string& subDataSetName);
395 
396  /*!
397  \brief Returns a reference to a static mutex initialized when this module is initialized.
398  \return Returns a reference to a static mutex initialized when this module is initialized.
399  */
400  TEGDALEXPORT boost::mutex& getStaticMutex();
401 
402  /*!
403  \brief Returns metadata from all registered GDAL drivers (key: driver name).
404  \return Metadata from all registered GDAL drivers (key: driver name).
405  */
406  std::map< std::string, DriverMetadata >& GetGDALDriversMetadata();
407 
408  /*!
409  \brief Returns a map of all GDAL supported Upper-case raster extensions to their respective driver names.
410  \param creationSupport Return only those extensions with dataset creation support.
411  \return Returns the result map.
412  */
413  std::multimap< std::string, std::string > GetGDALRasterDriversUCaseExt2DriversMap(
414  const bool creationSupport );
415 
416  /*!
417  \brief Returns a map of all GDAL supported Upper-case vector extensions to their respective driver names.
418  \param creationSupport Return only those extensions with dataset creation support.
419  \return Returns the result map.
420  */
421  std::multimap< std::string, std::string > GetGDALVectorDriversUCaseExt2DriversMap(
422  const bool creationSupport );
423 
424  /*!
425  \brief Returns a map of all GDAL supported Upper-case ( vector and raster ) extensions to their respective driver names.
426  \param creationSupport Return only those extensions with dataset creation support.
427  \return Returns the result map.
428  \note To get only vector extensiones use GetGDALVectorDriversUCaseExt2DriversMap(().
429  \note To get only raster extensiones use GetGDALRasterDriversUCaseExt2DriversMap(().
430  */
431  std::multimap< std::string, std::string > GetGDALAllDriversUCaseExt2DriversMap(
432  const bool creationSupport );
433 
434 
435  void GDALErrorHandler(CPLErr eErrClass, int errNo, const char* msg);
436  } // end namespace gdal
437 } // end namespace te
438 #endif
GDALColorInterp GetGDALColorInterpretation(te::rst::ColorInterp ci)
It translates a TerraLib ColorInterpretation to a GDAL ColorInterpretation.
Definition: Utils.h:153
HSL indexed palette interpretation.
Definition: Enums.h:86
Palette indexes color interpretation.
Definition: Enums.h:58
std::multimap< std::string, std::string > GetGDALAllDriversUCaseExt2DriversMap(const bool creationSupport)
Returns a map of all GDAL supported Upper-case ( vector and raster ) extensions to their respective d...
This is a class that represents a GDAL Raster.
bool m_subDatasetsSupport
true if the driver has support for sub-datasets (GDAL_DMD_SUBDATASETS).
Definition: Utils.h:68
void GDALErrorHandler(CPLErr eErrClass, int errNo, const char *msg)
GDALDataType GetGDALDataType(int tet)
It translates a TerraLib DataType to a GDAL DataType.
Definition: Utils.h:101
Near neighborhood interpolation method.
Definition: Enums.h:95
Hue channel color interpretation.
Definition: Enums.h:63
te::rst::PaletteInterpretation GetTePaletteInterpretation(GDALPaletteInterp gpi)
It translates a GDAL Pallete Interpretation to a TerraLib Pallete Interpretation. ...
Definition: Utils.h:180
Alpha channel color interpretation.
Definition: Enums.h:62
std::string m_driverName
Driver name (driver description).
Definition: Utils.h:65
Index into a lookup table.
Definition: Enums.h:57
Lightness color interpretation.
Definition: Enums.h:65
te::rst::ColorInterp GetTeColorInterpretation(GDALColorInterp gci)
It translates a GDAL ColorInterpretation to a TerraLib ColorInterpretation.
Definition: Utils.h:126
TEMAPEXPORT te::gm::Envelope GetExtent(const te::map::AbstractLayerPtr &layer, int srid, bool onlyVisibles)
It calculates the extent of the given layer in the given SRID.
ColorInterp
Color model component use.
Definition: Enums.h:54
TERASTEREXPORT std::vector< BandProperty * > GetBandProperties(const std::map< std::string, std::string > &rinfo)
Returns a vector of band properties, based on a given raster info.
A raster band description.
Definition: BandProperty.h:61
RGB indexed palette interpretation.
Definition: Enums.h:84
This class represents Raster data.
Definition: Raster.h:61
Base exception class for plugin module.
Definition: Exception.h:42
Gray indexed palette interpretation.
Definition: Enums.h:83
#define TEGDALEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:67
GDALDataset * GetRasterHandle(std::string strAccessInfo, te::common::AccessPolicy policy=te::common::RAccess)
Get a handle to a raster file.
Red channel color interpretation.
Definition: Enums.h:59
TERASTEREXPORT Grid * GetGrid(const std::map< std::string, std::string > &rinfo)
Returns a grid based on a given raster info.
#define TE_TR(message)
It marks a string in order to get translated.
Definition: Translator.h:242
Cyan color interpretation.
Definition: Enums.h:66
InterpolationMethod
Allowed interpolation methods.
Definition: Enums.h:92
GDALDataset * CreateRaster(const std::string &name, 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.
Raster property.
TEGDALEXPORT void Rasterize(std::vector< te::gm::Geometry * > geometries, GDALDataset *outraster)
Rasterizes a given vector of geometries, using GDALRasterizeGeometries function.
bool GetBands(te::gdal::Raster *rst, int multiResLevel, std::vector< te::gdal::Band * > &bands)
Gets the list of bands from a GDAL dataset.
std::string GetGDALRessamplingMethod(te::rst::InterpolationMethod interpolationMethod)
It translates a TerraLib interpolation method into a GDAL ressampling method name string...
Definition: Utils.h:195
int GetTeDataType(GDALDataType gt)
It translates a GDAL DataType to a TerraLib DataType.
Definition: Utils.h:77
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
std::string MakePGConnectionStr(const te::core::URI &connInfo)
Returns a PostGIS connection string from the URI connection information. The connection string is to ...
YCbCr Cr Band color interpretation.
Definition: Enums.h:72
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
std::vector< std::string > m_extensions
List of extensions handled by the driver (GDAL_DMD_EXTENSIONS).
Definition: Utils.h:66
An abstract class for raster data strucutures.
Definition: Raster.h:71
std::string GetParentDataSetName(const std::string &subDataSetName)
It returns the parent dataset name from a Sub DataSet name.
URI C++ Library.
bool m_supportCreation
Capability set by a driver having vector capability (GDAL_DCAP_CREATE).
Definition: Utils.h:71
No color interpretation is associated with the band.
Definition: Enums.h:56
Undefined palette interpretation.
Definition: Enums.h:82
bool m_isRaster
Capability set by a driver having raster capability (GDAL_DCAP_RASTER).
Definition: Utils.h:69
bool m_isVector
Capability set by a driver having vector capability (GDAL_DCAP_VECTOR).
Definition: Utils.h:70
Key (black) color interpretation.
Definition: Enums.h:69
Yellow color interpretation.
Definition: Enums.h:68
Bicubic interpolation method.
Definition: Enums.h:97
GDAL driver metadata.
Definition: Utils.h:63
A class for representing an Uniform Resource Identifier (URI).
Definition: URI.h:49
bool IsSubDataSet(const std::string &uri)
Returns true if the given URI is related to a sub-dataset.
TEOGREXPORT boost::mutex & getStaticMutex()
Returns a reference to a static mutex initialized when this module is initialized.
bool ReprojectRaster(te::rst::Raster const *const rin, te::rst::Raster *rout)
Reprojects a raster to another SRS.
std::multimap< std::string, std::string > GetGDALVectorDriversUCaseExt2DriversMap(const bool creationSupport)
Returns a map of all GDAL supported Upper-case vector extensions to their respective driver names...
bool RecognizesSRID(unsigned int srid)
It returns true if GDAL recognizes the given SRS id.
std::string GetGDALConnectionInfo(const std::map< std::string, std::string > &connInfo)
It returns a GDAL connection string from the given map.
TEMAPEXPORT te::rst::RasterProperty * GetRasterProperty(AbstractLayer *layer)
It gets the raster property referenced by the given data set layer.
std::string GetDriverName(const std::string &path)
It tries extract the driver name used by OGR Library based on the given path.
YCbCr Y Band color interpretation.
Definition: Enums.h:70
Bilinear interpolation method.
Definition: Enums.h:96
CMYK indexed palette interpretation.
Definition: Enums.h:85
Saturation color interpretation.
Definition: Enums.h:64
Blue channel color interpretation.
Definition: Enums.h:61
PaletteInterpretation
Palette interpratation types.
Definition: Enums.h:80
TEGDALEXPORT void Vectorize(GDALRasterBand *band, std::vector< te::gm::Geometry * > &geometries)
Vectorizes a given raster band, using GDALPolygonize function.
A rectified grid is the spatial support for raster data.
Definition: Grid.h:68
std::string m_longName
File long name (GDAL_DMD_LONGNAME).
Definition: Utils.h:67
std::string GetSubDataSetName(const std::string &name, const std::string &driverName)
It returns the Sub DataSet name from the given name or the same name.
Green channel color interpretation.
Definition: Enums.h:60
te::rst::BandProperty * GetBandProperty(GDALRasterBand *gband, const unsigned int bandIndex)
Gets the properties of a single band from a GDAL dataset.
Magenta color interpretation.
Definition: Enums.h:67
YCbCr Cb Band color interpretation.
Definition: Enums.h:71
std::map< std::string, DriverMetadata > & GetGDALDriversMetadata()
Returns metadata from all registered GDAL drivers (key: driver name).
Configuration flags for the GDAL Driver of TerraLib.
std::multimap< std::string, std::string > GetGDALRasterDriversUCaseExt2DriversMap(const bool creationSupport)
Returns a map of all GDAL supported Upper-case raster extensions to their respective driver names...