26 #ifndef __TERRALIB_GDAL_INTERNAL_UTILS_H
27 #define __TERRALIB_GDAL_INTERNAL_UTILS_H
30 #include "../raster/BandProperty.h"
31 #include "../raster/Enums.h"
32 #include "../raster/Raster.h"
33 #include "../core/translator/Translator.h"
39 #include <gdal_priv.h>
40 #include <cpl_error.h>
48 #include <boost/filesystem.hpp>
49 #include <boost/thread/mutex.hpp>
53 namespace gm {
class Envelope;
class Geometry;}
55 namespace rst {
class Grid;
class RasterProperty; }
57 namespace core {
class URI; }
120 default :
return GDT_Unknown;
174 default :
return GCI_Undefined;
198 switch(interpolationMethod)
283 const std::vector<te::rst::BandProperty*>& bands,
284 const std::map<std::string, std::string>& optParams,
285 const std::map<std::string, std::string>& metadata );
300 const std::vector<te::rst::BandProperty*>& bands,
301 const std::map<std::string, std::string>& optParams,
302 const std::map<std::string, std::string>& metaData );
424 const bool creationSupport );
432 const bool creationSupport );
442 const bool creationSupport );
453 std::map<std::string, std::string>& metadata );
#define TE_TR(message)
It marks a string in order to get translated.
A class to store the proxy information that must be used to access data located in URIs.
This class represents Raster data.
An Envelope defines a 2D rectangular region.
A raster band description.
A rectified grid is the spatial support for raster data.
An abstract class for raster data strucutures.
AccessPolicy
Supported data access policies (can be used as bitfield).
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)
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.
ScopedDataSetHandlePtr GetRasterHandle(std::string strAccessInfo, te::common::AccessPolicy policy=te::common::RAccess)
Get a handle to a raster file.
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...
TEGDALEXPORT boost::mutex & getStaticMutex()
Returns a reference to a static mutex initialized when this module is initialized.
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.
TEGDALEXPORT te::rst::Grid * GetGrid(GDALDataset *gds)
Gets the grid definition 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.
std::string GetDriverName(const std::string &dsName)
It returns the GDAL driver name associated to a data source name.
te::gm::Envelope * GetExtent(std::string strAccessInfo)
Gets the extent of a raster data decoded by GDAL.
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.
te::rst::BandProperty * GetBandProperty(GDALRasterBand *gband, const unsigned int bandIndex)
Gets the properties of a single band from a GDAL dataset.
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.
te::rst::RasterProperty * GetRasterProperty(std::string strAccessInfo)
Gets the complete description from a GDAL dataset.
std::map< std::string, DriverMetadata > & GetGDALDriversMetadata()
Returns metadata from all registered GDAL drivers (key: driver name).
te::rst::PaletteInterpretation GetTePaletteInterpretation(GDALPaletteInterp gpi)
It translates a GDAL Pallete Interpretation to a TerraLib Pallete Interpretation.
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.
GDALColorInterp GetGDALColorInterpretation(te::rst::ColorInterp ci)
It translates a TerraLib ColorInterpretation to a GDAL ColorInterpretation.
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.
@ Bicubic
Bicubic interpolation method.
@ Bilinear
Bilinear interpolation method.
@ NearestNeighbor
Near neighborhood interpolation method.
PaletteInterpretation
Palette interpratation types.
@ HSLPalInt
HSL indexed palette interpretation.
@ GrayPalInt
Gray indexed palette interpretation.
@ CMYKPalInt
CMYK indexed palette interpretation.
@ UndefPalInt
Undefined palette interpretation.
@ RGBPalInt
RGB indexed palette interpretation.
ColorInterp
Color model component use.
@ AlphaCInt
Alpha channel color interpretation.
@ KeyCInt
Key (black) color interpretation.
@ GrayIdxCInt
Index into a lookup table.
@ PaletteIdxCInt
Palette indexes color interpretation.
@ UndefCInt
No color interpretation is associated with the band.
@ LigCInt
Lightness color interpretation.
@ HueCInt
Hue channel color interpretation.
@ YCInt
YCbCr Y Band color interpretation.
@ CrCInt
YCbCr Cr Band color interpretation.
@ GreenCInt
Green channel color interpretation.
@ RedCInt
Red channel color interpretation.
@ CyanCInt
Cyan color interpretation.
@ SatCInt
Saturation color interpretation.
@ CbCInt
YCbCr Cb Band color interpretation.
@ MagentaCInt
Magenta color interpretation.
@ YellowCInt
Yellow color interpretation.
@ BlueCInt
Blue channel color interpretation.
Base exception class for plugin module.
Raster implementaton for TerraLib 4.x.
#define TEGDALEXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).