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 "../common/Translator.h" 39 #include <gdal_priv.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; }
114 default :
return GDT_Unknown;
168 default :
return GCI_Undefined;
192 switch(interpolationMethod)
274 GDALDataset*
CreateRaster(
te::rst::Grid* g,
const std::vector<te::rst::BandProperty*>& bands,
const std::map<std::string, std::string>& optParams);
287 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);
349 std::string
GetSubDataSetName(
const std::string& name,
const std::string& driverName);
GDALColorInterp GetGDALColorInterpretation(te::rst::ColorInterp ci)
It translates a TerraLib ColorInterpretation to a GDAL ColorInterpretation.
HSL indexed palette interpretation.
Palette indexes color interpretation.
This is a class that represents a GDAL Raster.
GDALDataType GetGDALDataType(int tet)
It translates a TerraLib DataType to a GDAL DataType.
Near neighborhood interpolation method.
const std::multimap< std::string, std::string > & GetGDALDriversUCaseExt2DriversMap()
Returns a map all GDAL supported Upper-case extensions to their respective driver names...
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.
It gives access to values in one band (dimension) of a raster.
#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.
TEMAPEXPORT te::rst::RasterProperty * GetRasterProperty(DataSetLayer *layer)
It gets the raster property referenced by the given data set layer.
Yellow color interpretation.
Bicubic interpolation method.
TEGDALEXPORT boost::mutex & getStaticMutex()
Returns a reference to a static mutex initialized when this module is initialized.
bool IsSubDataSet(const std::string &uri)
Returns true if the given URI is related to a sub-dataset.
bool ReprojectRaster(te::rst::Raster const *const rin, te::rst::Raster *rout)
Reprojects a raster to another SRS.
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.
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.
const std::map< std::string, DriverMetadata > & GetGDALDriversMetadata()
Returns metadata from all registered GDAL drivers (key: driver name).
Configuration flags for the GDAL Driver of TerraLib.