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" 38 #include <gdal_priv.h> 39 #include <cpl_error.h> 47 #include <boost/filesystem.hpp> 48 #include <boost/thread/mutex.hpp> 52 namespace gm {
class Envelope;
class Geometry;}
54 namespace rst {
class Grid;
class RasterProperty; }
117 default :
return GDT_Unknown;
171 default :
return GCI_Undefined;
195 switch(interpolationMethod)
277 GDALDataset*
CreateRaster(
te::rst::Grid* g,
const std::vector<te::rst::BandProperty*>& bands,
const std::map<std::string, std::string>& optParams);
290 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);
352 std::string
GetSubDataSetName(
const std::string& name,
const std::string& driverName);
412 const bool creationSupport );
420 const bool creationSupport );
430 const bool creationSupport );
GDALColorInterp GetGDALColorInterpretation(te::rst::ColorInterp ci)
It translates a TerraLib ColorInterpretation to a GDAL ColorInterpretation.
HSL indexed palette interpretation.
Palette indexes color interpretation.
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.
void GDALErrorHandler(CPLErr eErrClass, int errNo, const char *msg)
GDALDataType GetGDALDataType(int tet)
It translates a TerraLib DataType to a GDAL DataType.
Near neighborhood interpolation method.
Hue channel color interpretation.
te::rst::PaletteInterpretation GetTePaletteInterpretation(GDALPaletteInterp gpi)
It translates a GDAL Pallete Interpretation to a TerraLib Pallete Interpretation. ...
Alpha channel color interpretation.
Index into a lookup table.
Lightness color interpretation.
te::rst::ColorInterp GetTeColorInterpretation(GDALColorInterp gci)
It translates a GDAL ColorInterpretation to a TerraLib ColorInterpretation.
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.
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.
RGB indexed palette interpretation.
This class represents Raster data.
Base exception class for plugin module.
Gray indexed palette interpretation.
#define TEGDALEXPORT
You can use this macro in order to export/import classes and functions from this module.
GDALDataset * GetRasterHandle(std::string strAccessInfo, te::common::AccessPolicy policy=te::common::RAccess)
Get a handle to a raster file.
Red channel color interpretation.
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.
Cyan color interpretation.
InterpolationMethod
Allowed interpolation methods.
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.
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...
int GetTeDataType(GDALDataType gt)
It translates a GDAL DataType to a TerraLib DataType.
AccessPolicy
Supported data access policies (can be used as bitfield).
YCbCr Cr Band color interpretation.
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
std::string GetParentDataSetName(const std::string &subDataSetName)
It returns the parent dataset name from a Sub DataSet name.
No color interpretation is associated with the band.
Undefined palette interpretation.
Key (black) color interpretation.
Yellow color interpretation.
Bicubic interpolation method.
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 MakePGConnectionStr(const std::map< std::string, std::string > &dsInfo)
Returns a PostGIS connection string from the set connection information. The connection string is to ...
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.
Bilinear interpolation method.
CMYK indexed palette interpretation.
Saturation color interpretation.
Blue channel color interpretation.
PaletteInterpretation
Palette interpratation types.
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.
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.
te::rst::BandProperty * GetBandProperty(GDALRasterBand *gband, const unsigned int bandIndex)
Gets the properties of a single band from a GDAL dataset.
Magenta color interpretation.
YCbCr Cb Band color interpretation.
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...