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