26 #ifndef __TERRALIB_RASTER_INTERNAL_GRID_H
27 #define __TERRALIB_RASTER_INTERNAL_GRID_H
30 #include "../geometry/Coord2D.h"
31 #include "../srs/Config.h"
35 #include <boost/shared_ptr.hpp>
40 namespace gm {
class Envelope; }
83 Grid(
unsigned int nCols = 0,
unsigned int nRows = 0,
98 Grid(
unsigned int nCols,
unsigned int nRows,
99 double resX,
double resY,
114 Grid(
unsigned int nCols,
unsigned int nRows,
115 double resX,
double resY,
141 Grid(
const double geoTrans[],
unsigned int nCols,
unsigned int nRows,
239 void gridToGeo(
const double& col,
const double& row,
double& x,
double& y)
const;
259 void geoToGrid(
const double& x,
const double& y,
double& col,
double& row)
const;
288 bool isPointInGrid(
unsigned int col,
unsigned int row)
const;
297 double m_geoTInverse[6];
315 const double extentHeight,
316 const unsigned int nColumns,
317 const unsigned int nRows,
318 const double extentULX,
319 const double extentULY,
320 double* affineParamsPtr,
321 double* inverseAffineParamsPtr )
const;
330 double* inverseAffineParamsPtr )
const;
An Envelope defines a 2D rectangular region.
A rectified grid is the spatial support for raster data.
const te::gm::Envelope * getExtent() const
Returns the geographic extension of the grid.
void gridToGeo(const double &col, const double &row, double &x, double &y) const
Get the spatial location of a grid point.
bool computeInverseParameters(double *const affineParamsPtr, double *inverseAffineParamsPtr) const
Compute inverse affine parameters.
void setSRID(int srid)
Just sets the grid spatial reference system identifier.
int getSRID() const
Returns the grid spatial reference system identifier.
void setGeoreference(const te::gm::Coord2D &ulLocation, int srid, double resX, double resY)
Sets the information needed to georeference the grid.
unsigned int getNumberOfColumns() const
Returns the grid number of columns.
double getResolutionY() const
Returns the grid vertical (y-axis) resolution.
bool isPointInGrid(unsigned int col, unsigned int row) const
void setNumberOfRows(unsigned int nRows)
Sets the grid number of rows.
Grid & operator=(const Grid &rhs)
Assignment operator.
const double * getGeoreference() const
Returns a list of 6 coefficients describing an affine transformation to georeference a grid.
unsigned int getNumberOfRows() const
Returns the grid number of rows.
void setNumberOfColumns(unsigned int nCols)
Sets the grid number of columns.
int m_srid
The associated SRS.
unsigned int m_nCols
Number of columns.
unsigned int m_nRows
Number of rows.
bool operator==(const Grid &rhs) const
Equal operator.
void setGeoreference(const double geoTrans[], int srid)
Sets the information needed to georeference the grid using an affine transformation.
bool computeAffineParameters(const double extentWidth, const double extentHeight, const unsigned int nColumns, const unsigned int nRows, const double extentULX, const double extentULY, double *affineParamsPtr, double *inverseAffineParamsPtr) const
Compute affine parameters from the given input parameters.
Grid(double resX, double resY, te::gm::Envelope *mbr, int srid=TE_UNKNOWN_SRS)
Constructor.
void geoToGrid(const double &x, const double &y, double &col, double &row) const
Get the grid point associated to a spatial location.
void computeExtent() const
Computes the geographic extension of the grid.
Grid(unsigned int nCols, unsigned int nRows, double resX, double resY, const te::gm::Coord2D *ulc, int srid=TE_UNKNOWN_SRS)
Constructor.
te::gm::Envelope * m_extent
The grid extent.
Grid(const Grid &rhs)
Copy constructor.
Grid(unsigned int nCols=0, unsigned int nRows=0, te::gm::Envelope *mbr=0, int srid=TE_UNKNOWN_SRS)
Constructor.
Grid(unsigned int nCols, unsigned int nRows, double resX, double resY, te::gm::Envelope *mbr, int srid=TE_UNKNOWN_SRS)
Constructor.
double getResolutionX() const
Returns the grid horizontal (x-axis) resolution.
Grid(const double geoTrans[], unsigned int nCols, unsigned int nRows, int srid=TE_UNKNOWN_SRS)
Constructor.
te::gm::Envelope * getExtent()
Returns the geographic extension of the grid.
boost::shared_ptr< Grid > GridPtr
An utility struct for representing 2D coordinates.
#define TERASTEREXPORT
You can use this macro in order to export/import classes and functions from this module.
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
Proxy configuration file for TerraView (see terraview_config.h).