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