20 #ifndef _IMGRASTERGDAL_H_
21 #define _IMGRASTERGDAL_H_
30 #include "gdal_priv.h"
32 enum RESAMPLE { NEAR = 0, BILINEAR = 1, BICUBIC = 2 };
41 virtual void close(
void);
42 std::string getFileName()
const {
return m_filename;};
43 int nrOfCol(
void)
const {
return m_ncol;};
44 int nrOfRow(
void)
const {
return m_nrow;};
45 int nrOfBand(
void)
const {
return m_nband;};
46 bool isGeoRef()
const {
double gt[6];getGeoTransform(gt);
if(gt[5]<0)
return true;
else return false;};
47 std::string getProjection(
void)
const;
48 std::string getProjectionRef(
void)
const;
49 std::string getGeoTransform()
const;
50 void getGeoTransform(
double* gt)
const;
51 bool getBoundingBox (
double& ulx,
double& uly,
double& lrx,
double& lry)
const;
52 bool getCenterPos(
double& x,
double& y)
const;
53 double getUlx()
const {
double ulx, uly, lrx,lry;getBoundingBox(ulx,uly,lrx,lry);
return(ulx);};
54 double getUly()
const {
double ulx, uly, lrx,lry;getBoundingBox(ulx,uly,lrx,lry);
return(uly);};
55 double getLrx()
const {
double ulx, uly, lrx,lry;getBoundingBox(ulx,uly,lrx,lry);
return(lrx);};
56 double getLry()
const {
double ulx, uly, lrx,lry;getBoundingBox(ulx,uly,lrx,lry);
return(lry);};
58 int getNoDataValues(std::vector<double>& noDataValues)
const;
59 bool isNoData(
double value)
const{
if(m_noDataValues.empty())
return false;
else return find(m_noDataValues.begin(),m_noDataValues.end(),value)!=m_noDataValues.end();};
60 int pushNoDataValue(
double noDataValue);
61 int setNoData(
const std::vector<double> nodata){m_noDataValues=nodata;
return(m_noDataValues.size());};
62 CPLErr GDALSetNoDataValue(
double noDataValue,
int band=0) {
return getRasterBand(band)->SetNoDataValue(noDataValue);};
63 bool covers(
double x,
double y)
const;
64 bool covers(
double ulx,
double uly,
double lrx,
double lry)
const;
65 bool geo2image(
double x,
double y,
double& i,
double& j)
const;
66 bool image2geo(
double i,
double j,
double& x,
double& y)
const;
67 double getDeltaX(
void)
const {
double gt[6];getGeoTransform(gt);
return gt[1];};
68 double getDeltaY(
void)
const {
double gt[6];getGeoTransform(gt);
return -gt[5];};
70 GDALDataType getDataType(
int band=0)
const;
71 GDALRasterBand* getRasterBand(
int band=0);
72 GDALColorTable* getColorTable(
int band=0)
const;
73 std::string getDriverDescription()
const;
74 std::string getImageType()
const{
return getDriverDescription();};
76 std::string getInterleave()
const;
77 std::string getCompression()
const;
78 GDALDataset* getDataset(){
return m_gds;};
80 char** getMetadata()
const;
81 void getMetadata(std::list<std::string>& metadata)
const;
83 std::string getDescription()
const;
84 std::string getMetadataItem()
const;
85 std::string getImageDescription()
const;
91 std::string m_filename;
97 std::vector<double> m_noDataValues;
100 #endif // _IMGRASTERGDAL_H_