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"
37 #include <gdal_priv.h>
43 #include <boost/filesystem.hpp>
47 namespace gm {
class Envelope;
class Geometry;}
49 namespace rst {
class Grid;
class RasterProperty; }
98 default :
return GDT_Unknown;
152 default :
return GCI_Undefined;
183 void GetBandProperties(GDALDataset* gds, std::vector<te::rst::BandProperty*>& bprops);
225 GDALDataset*
CreateRaster(
te::rst::Grid* g,
const std::vector<te::rst::BandProperty*>& bands,
const std::map<std::string, std::string>& optParams);
238 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);
300 std::string
GetSubDataSetName(
const std::string& name,
const std::string& driverName);
te::rst::RasterProperty * GetRasterProperty(std::string strAccessInfo)
Gets the complete description from a GDAL dataset.
Palette indexes color interpretation.
std::string GetGDALConnectionInfo(const std::map< std::string, std::string > &connInfo)
It returns a GDAL connection string from the given map.
bool RecognizesSRID(unsigned int srid)
It returns true if GDAL recognizes the given SRS id.
CMYK indexed palette interpretation.
Key (black) color interpretation.
Blue channel color interpretation.
ColorInterp
Color model component use.
Lightness color interpretation.
te::rst::ColorInterp GetTeColorInterpretation(GDALColorInterp gci)
It translates a GDAL ColorInterpretation to a TerraLib ColorInterpretation.
GDALDataType GetGDALDataType(int tet)
It translates a TerraLib DataType to a GDAL DataType.
This class represents Raster data.
void GetBands(te::gdal::Raster *rst, std::vector< te::gdal::Band * > &bands)
Gets the list of bands 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)
Creates a raster data using GDAL.
No color interpretation is associated with the band.
It gives access to values in one band (dimension) of a raster.
std::string GetParentDataSetName(const std::string &subDataSetName)
It returns the parent dataset name from a Sub DataSet name.
Undefined palette interpretation.
Alpha channel color interpretation.
GDALColorInterp GetGDALColorInterpretation(te::rst::ColorInterp ci)
It translates a TerraLib ColorInterpretation to a GDAL ColorInterpretation.
Cyan color interpretation.
GDALDataset * GetRasterHandle(std::string strAccessInfo, te::common::AccessPolicy policy=te::common::RAccess)
Get a handle to a raster file.
AccessPolicy
Supported data access policies (can be used as bitfield).
te::rst::PaletteInterpretation GetTePaletteInterpretation(GDALPaletteInterp gpi)
It translates a GDAL Pallete Interpretation to a TerraLib Pallete Interpretation. ...
Hue channel color interpretation.
Red channel color interpretation.
A rectified grid is the spatial support for raster data.
TEGDALEXPORT void Vectorize(GDALRasterBand *band, std::vector< te::gm::Geometry * > &geometries)
Vectorizes a given raster band, using GDALPolygonize function.
Yellow color interpretation.
bool IsSubDataSet(const std::string &uri)
Returns true if the given URI is related to a sub-dataset.
te::rst::Grid * GetGrid(GDALDataset *gds)
Gets the grid definition from a GDAL dataset.
void GetBandProperties(GDALDataset *gds, std::vector< te::rst::BandProperty * > &bprops)
Gets the list of bands definition from a GDAL dataset.
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 ...
PaletteInterpretation
Palette interpratation types.
#define TEGDALEXPORT
You can use this macro in order to export/import classes and functions from this module.
A raster band description.
YCbCr Cr Band color interpretation.
YCbCr Y Band color interpretation.
This is a class that represents a GDAL Raster.
Gray indexed palette interpretation.
bool ReprojectRaster(te::rst::Raster const *const rin, te::rst::Raster *rout)
Reprojects a raster to another SRS.
Saturation color interpretation.
Magenta color interpretation.
RGB indexed palette interpretation.
An abstract class for raster data strucutures.
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.
int GetTeDataType(GDALDataType gt)
It translates a GDAL DataType to a TerraLib DataType.
YCbCr Cb Band color interpretation.
std::string GetDriverName(const std::string &dsName)
It returns the GDAL driver name associated to a data source name.
te::rst::BandProperty * GetBandProperty(GDALRasterBand *gband, const unsigned int bandIndex)
Gets the properties of a single band from a GDAL dataset.
An Envelope defines a 2D rectangular region.
TEGDALEXPORT void Rasterize(std::vector< te::gm::Geometry * > geometries, GDALDataset *outraster)
Rasterizes a given vector of geometries, using GDALRasterizeGeometries function.
Index into a lookup table.
Green channel color interpretation.
te::gm::Envelope * GetExtent(std::string strAccessInfo)
Gets the extent of a raster data decoded by GDAL.
HSL indexed palette interpretation.