A rectified grid is the spatial support for raster data. More...
#include <Grid.h>
Public Member Functions | |
| void | computeExtent () const | 
| Computes the geographic extension of the grid.  More... | |
| void | geoToGrid (const double &x, const double &y, double &col, double &row) const | 
| Get the grid point associated to a spatial location.  More... | |
| te::gm::Coord2D | geoToGrid (const double &x, const double &y) const | 
| Get the grid point associated to a spatial location.  More... | |
| te::gm::Envelope * | getExtent () | 
| Returns the geographic extension of the grid.  More... | |
| const te::gm::Envelope * | getExtent () const | 
| Returns the geographic extension of the grid.  More... | |
| const double * | getGeoreference () const | 
| Returns a list of 6 coefficients describing an affine transformation to georeference a grid.  More... | |
| unsigned int | getNumberOfColumns () const | 
| Returns the grid number of columns.  More... | |
| unsigned int | getNumberOfRows () const | 
| Returns the grid number of rows.  More... | |
| double | getResolutionX () const | 
| Returns the grid horizontal (x-axis) resolution.  More... | |
| double | getResolutionY () const | 
| Returns the grid vertical (y-axis) resolution.  More... | |
| int | getSRID () const | 
| Returns the grid spatial reference system identifier.  More... | |
| Grid (unsigned int nCols=0, unsigned int nRows=0, te::gm::Envelope *mbr=0, int srid=TE_UNKNOWN_SRS) | |
| Constructor.  More... | |
| Grid (unsigned int nCols, unsigned int nRows, double resX, double resY, const te::gm::Coord2D *ulc, int srid=TE_UNKNOWN_SRS) | |
| Constructor.  More... | |
| Grid (unsigned int nCols, unsigned int nRows, double resX, double resY, te::gm::Envelope *mbr, int srid=TE_UNKNOWN_SRS) | |
| Constructor.  More... | |
| Grid (double resX, double resY, te::gm::Envelope *mbr, int srid=TE_UNKNOWN_SRS) | |
| Constructor.  More... | |
| Grid (const double geoTrans[], unsigned int nCols, unsigned int nRows, int srid=TE_UNKNOWN_SRS) | |
| Constructor.  More... | |
| Grid (const Grid &rhs) | |
| Copy constructor.  More... | |
| void | gridToGeo (const double &col, const double &row, double &x, double &y) const | 
| Get the spatial location of a grid point.  More... | |
| te::gm::Coord2D | gridToGeo (const double &col, const double &row) const | 
| Get the spatial location of a grid point.  More... | |
| bool | isPointInGrid (unsigned int col, unsigned int row) const | 
| Grid & | operator= (const Grid &rhs) | 
| Assignment operator.  More... | |
| bool | operator== (const Grid &rhs) const | 
| Equal operator.  More... | |
| void | setGeoreference (const te::gm::Coord2D &ulLocation, int srid, double resX, double resY) | 
| Sets the information needed to georeference the grid.  More... | |
| void | setGeoreference (const double geoTrans[], int srid) | 
| Sets the information needed to georeference the grid using an affine transformation.  More... | |
| void | setNumberOfColumns (unsigned int nCols) | 
| Sets the grid number of columns.  More... | |
| void | setNumberOfRows (unsigned int nRows) | 
| Sets the grid number of rows.  More... | |
| void | setSRID (int srid) | 
| Just sets the grid spatial reference system identifier.  More... | |
| ~Grid () | |
| Destructor.  More... | |
Private Attributes | |
| te::gm::Envelope * | m_extent | 
| The grid extent.  More... | |
| double | m_geoT [6] | 
| A list of 6 coefficients describing an affine transformation to georeference a grid. In a north up image, m_geoT[1] is the pixel width, and m_geoT[5] is the pixel height. The upper left corner of the upper left pixel is at position (m_geoT[0],m_geoT[3]).  More... | |
| unsigned int | m_nCols | 
| Number of columns.  More... | |
| unsigned int | m_nRows | 
| Number of rows.  More... | |
| int | m_srid | 
| The associated SRS.  More... | |
A rectified grid is the spatial support for raster data.
| te::rst::Grid::Grid | ( | unsigned int | nCols = 0,  | 
        
| unsigned int | nRows = 0,  | 
        ||
| te::gm::Envelope * | mbr = 0,  | 
        ||
| int | srid = TE_UNKNOWN_SRS  | 
        ||
| ) | 
Constructor.
| nCols | The number of columns. | 
| nRows | The number of rows. | 
| srid | The SRS associated to the grid. | 
| mbr | The grid extent. The grid will take the ownership of the given envelope. | 
Definition at line 36 of file Grid.cpp.
References computeExtent(), te::gm::Envelope::getHeight(), te::gm::Envelope::getWidth(), m_extent, m_geoT, te::gm::Envelope::m_llx, te::gm::Envelope::m_ury, and setGeoreference().
| te::rst::Grid::Grid | ( | unsigned int | nCols, | 
| unsigned int | nRows, | ||
| double | resX, | ||
| double | resY, | ||
| const te::gm::Coord2D * | ulc, | ||
| int | srid = TE_UNKNOWN_SRS  | 
        ||
| ) | 
Constructor.
| nCols | The number of columns. | 
| nRows | The number of rows. | 
| resX | The grid horizontal (x-axis) resolution. | 
| resY | The grid vertical (y-axis) resolution. | 
| ulc | The location of the upper-left corner of the upper-left pixel (or cell) of the grid assuming srid as the SRS. | 
| srid | The SRS associated to the grid. | 
Definition at line 66 of file Grid.cpp.
References computeExtent(), and setGeoreference().
| te::rst::Grid::Grid | ( | unsigned int | nCols, | 
| unsigned int | nRows, | ||
| double | resX, | ||
| double | resY, | ||
| te::gm::Envelope * | mbr, | ||
| int | srid = TE_UNKNOWN_SRS  | 
        ||
| ) | 
Constructor.
| nCols | The number of columns. | 
| nRows | The number of rows. | 
| resX | The grid horizontal (x-axis) resolution. | 
| resY | The grid vertical (y-axis) resolution. | 
| mbr | The grid extent. The grid will take the ownership of the given envelope. | 
| srid | The SRS associated to the grid. | 
Definition at line 81 of file Grid.cpp.
References computeExtent(), te::gm::Envelope::getHeight(), te::gm::Envelope::getWidth(), m_extent, m_geoT, te::gm::Envelope::m_llx, te::gm::Envelope::m_ury, and setGeoreference().
| te::rst::Grid::Grid | ( | double | resX, | 
| double | resY, | ||
| te::gm::Envelope * | mbr, | ||
| int | srid = TE_UNKNOWN_SRS  | 
        ||
| ) | 
Constructor.
| resX | The grid horizontal (x-axis) resolution. | 
| resY | The grid vertical (y-axis) resolution. | 
| mbr | The grid extent. The grid will take the ownership of the given envelope. | 
| srid | The SRS associated to the grid. | 
Definition at line 109 of file Grid.cpp.
References te::gm::Envelope::getHeight(), te::gm::Envelope::getWidth(), m_extent, m_geoT, te::gm::Envelope::m_llx, m_nCols, m_nRows, and te::gm::Envelope::m_ury.
| te::rst::Grid::Grid | ( | const double | geoTrans[], | 
| unsigned int | nCols, | ||
| unsigned int | nRows, | ||
| int | srid = TE_UNKNOWN_SRS  | 
        ||
| ) | 
Constructor.
| nCols | The number of columns. | 
| nRows | The number of rows. | 
| geoTrans[] | A list of 6 coefficients describing an affine transformation to georeference a grid. | 
| srid | The SRS associated to the grid. | 
Definition at line 133 of file Grid.cpp.
References computeExtent(), and setGeoreference().
| te::rst::Grid::Grid | ( | const Grid & | rhs | ) | 
Copy constructor.
| rhs | The right-hand-side object to be used to copy from. | 
Definition at line 144 of file Grid.cpp.
References computeExtent(), m_extent, and m_geoT.
| void te::rst::Grid::computeExtent | ( | ) | const | 
Computes the geographic extension of the grid.
Definition at line 286 of file Grid.cpp.
References te::gm::Envelope::init(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
Referenced by Grid(), and operator==().
| void te::rst::Grid::geoToGrid | ( | const double & | x, | 
| const double & | y, | ||
| double & | col, | ||
| double & | row | ||
| ) | const | 
Get the grid point associated to a spatial location.
| x | The spatial x-coordiante. | 
| y | The spatial y-coordiante. | 
| col | The grid point column. | 
| row | The grid point row. | 
Definition at line 308 of file Grid.cpp.
Referenced by te::graph::AddRasterAttribute::AddRasterAttribute(), te::rst::Copy(), te::map::DrawRaster(), te::rp::GeoMosaic::execute(), te::rp::TiePointsMosaic::execute(), geoToGrid(), te::map::GetExtentRaster(), te::qt::widgets::Info::getRasterInfo(), te::rp::Blender::initialize(), InterpolateIn(), te::rst::LineIterator< T >::LineIterator(), te::qt::widgets::TiePointsLocatorDialog::on_autoAcquireTiePointsPushButton_clicked(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay1_coordTracked(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay2_coordTracked(), te::qt::widgets::TiePointLocatorWidget::onAutoAcquireTiePointsToolButtonClicked(), te::rst::PointSetIterator< T >::PointSetIterator(), and te::rst::PolygonIterator< T >::PolygonIterator().
      
  | 
  inline | 
Get the grid point associated to a spatial location.
| x | The spatial x-coordiante. | 
| y | The spatial y-coordiante. | 
Definition at line 304 of file Grid.h.
References geoToGrid(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
| te::gm::Envelope * te::rst::Grid::getExtent | ( | ) | 
Returns the geographic extension of the grid.
Definition at line 276 of file Grid.cpp.
Referenced by te::rp::GeoMosaic::execute(), te::rp::TiePointsMosaic::execute(), te::rp::SequenceMosaic::execute(), te::gdal::DataSet::getExtent(), te::gdal::Transactor::getExtent(), te::gdal::GetExtent(), te::qt::widgets::DataSet2Layer::operator()(), te::serialize::xml::Save(), te::rp::IHSFusion::saveIHSData(), and te::qt::widgets::UpdateProperty::setRasterPropertyData().
| const te::gm::Envelope * te::rst::Grid::getExtent | ( | ) | const | 
| const double * te::rst::Grid::getGeoreference | ( | ) | const | 
Returns a list of 6 coefficients describing an affine transformation to georeference a grid.
Definition at line 251 of file Grid.cpp.
Referenced by te::gdal::CreateRaster(), operator==(), and te::serialize::xml::Save().
| unsigned int te::rst::Grid::getNumberOfColumns | ( | ) | const | 
Returns the grid number of columns.
Definition at line 205 of file Grid.cpp.
Referenced by te::gdal::CreateRaster(), te::rp::TiePointsMosaic::execute(), te::mem::ExpansibleRaster::ExpansibleRaster(), te::map::GetExtentRaster(), te::serialize::xml::Save(), and te::qt::widgets::UpdateProperty::setRasterPropertyData().
| unsigned int te::rst::Grid::getNumberOfRows | ( | ) | const | 
Returns the grid number of rows.
Definition at line 215 of file Grid.cpp.
Referenced by te::gdal::CreateRaster(), te::rp::TiePointsMosaic::execute(), te::mem::ExpansibleRaster::ExpansibleRaster(), te::map::GetExtentRaster(), te::serialize::xml::Save(), and te::qt::widgets::UpdateProperty::setRasterPropertyData().
| double te::rst::Grid::getResolutionX | ( | ) | const | 
Returns the grid horizontal (x-axis) resolution.
Definition at line 256 of file Grid.cpp.
Referenced by te::rp::GeoMosaic::execute(), te::rp::TiePointsMosaic::execute(), te::rp::Segmenter::segmenterThreadEntry(), and te::qt::widgets::UpdateProperty::setRasterPropertyData().
| double te::rst::Grid::getResolutionY | ( | ) | const | 
Returns the grid vertical (y-axis) resolution.
Definition at line 261 of file Grid.cpp.
Referenced by te::rp::GeoMosaic::execute(), te::rp::TiePointsMosaic::execute(), te::rp::Segmenter::segmenterThreadEntry(), and te::qt::widgets::UpdateProperty::setRasterPropertyData().
| int te::rst::Grid::getSRID | ( | ) | const | 
Returns the grid spatial reference system identifier.
Definition at line 266 of file Grid.cpp.
Referenced by te::gdal::CreateRaster(), te::rp::GeoMosaic::execute(), te::rp::TiePointsMosaic::execute(), te::rp::SequenceMosaic::execute(), te::qt::widgets::DataSet2Layer::operator()(), te::serialize::xml::Save(), te::rp::IHSFusion::saveIHSData(), te::rp::Segmenter::segmenterThreadEntry(), and te::qt::widgets::UpdateProperty::setRasterPropertyData().
| void te::rst::Grid::gridToGeo | ( | const double & | col, | 
| const double & | row, | ||
| double & | x, | ||
| double & | y | ||
| ) | const | 
Get the spatial location of a grid point.
| col | The grid point column. | 
| row | The grid point row. | 
| x | The spatial location (X axis). | 
| y | The spatial location (Y axis). | 
Definition at line 302 of file Grid.cpp.
Referenced by te::rst::Copy(), te::rp::GeoMosaic::execute(), te::rp::Register::execute(), te::rp::TiePointsMosaic::execute(), te::map::GetExtentRaster(), te::rp::GetRandomPointsInRaster(), gridToGeo(), InterpolateIn(), te::rst::LineIterator< T >::LineIterator(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay1_extentChanged(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay2_extentChanged(), and te::rp::Segmenter::segmenterThreadEntry().
      
  | 
  inline | 
Get the spatial location of a grid point.
| col | The grid point column. | 
| row | The grid point row. | 
Definition at line 297 of file Grid.h.
References gridToGeo(), te::gm::Coord2D::x, and te::gm::Coord2D::y.
      
  | 
  inline | 
Definition at line 311 of file Grid.h.
References m_nCols, and m_nRows.
Referenced by InterpolateIn().
| te::rst::Grid & te::rst::Grid::operator= | ( | const Grid & | rhs | ) | 
| bool te::rst::Grid::operator== | ( | const Grid & | rhs | ) | const | 
Equal operator.
| rhs | The source object to be compared. | 
Definition at line 314 of file Grid.cpp.
References computeExtent(), getGeoreference(), m_extent, m_nCols, m_nRows, and m_srid.
| void te::rst::Grid::setGeoreference | ( | const te::gm::Coord2D & | ulLocation, | 
| int | srid, | ||
| double | resX, | ||
| double | resY | ||
| ) | 
Sets the information needed to georeference the grid.
Specifies a transformation that maps a grid point (col, row) to a spatial location (x, y).
This method should be used when there is no translation associated to the mapping.
| ulLocation | The location of the upper-left corner of the upper-left pixel (or cell) of the grid. | 
| srid | The id of the SRS that the location refers to. resX The grid horizontal (x-axis) resolution resY The grid vertical (y-axis) resolution | 
Definition at line 220 of file Grid.cpp.
References te::gm::Coord2D::x, and te::gm::Coord2D::y.
Referenced by te::qt::widgets::AddProperty::buildRasterProperty(), Grid(), te::serialize::xml::ReadGrid(), and te::rst::Raster::trim().
| void te::rst::Grid::setGeoreference | ( | const double | geoTrans[], | 
| int | srid | ||
| ) | 
Sets the information needed to georeference the grid using an affine transformation.
An affine transformation maps grid point (col,lin) to a spatial location (x,y) using to the following relationship:
X = geoTrans(0) + col*geoTrans(1) + lin*geoTrans(2) Y = geoTrans(3) + col*geoTrans(4) + lin*geoTrans(5)
This method should be used mainly when there is a translation associated to the mapping. Otherwise use the method above.
| geoTrans[] | A list of 6 coefficients describing an affine transformation to georeference a grid. | 
| srid | The SRS id to which the location refers to. | 
| void te::rst::Grid::setNumberOfColumns | ( | unsigned int | nCols | ) | 
Sets the grid number of columns.
| nCols | The number of columns. | 
Definition at line 200 of file Grid.cpp.
Referenced by te::rst::Raster::trim().
| void te::rst::Grid::setNumberOfRows | ( | unsigned int | nRows | ) | 
Sets the grid number of rows.
| nRows | The number of rows. | 
Definition at line 210 of file Grid.cpp.
Referenced by te::rst::Raster::trim().
| void te::rst::Grid::setSRID | ( | int | srid | ) | 
      
  | 
  mutableprivate | 
The grid extent.
Definition at line 288 of file Grid.h.
Referenced by Grid(), operator=(), and operator==().
      
  | 
  private | 
A list of 6 coefficients describing an affine transformation to georeference a grid. In a north up image, m_geoT[1] is the pixel width, and m_geoT[5] is the pixel height. The upper left corner of the upper left pixel is at position (m_geoT[0],m_geoT[3]).
Definition at line 292 of file Grid.h.
Referenced by Grid(), and operator=().
      
  | 
  private | 
Number of columns.
Definition at line 289 of file Grid.h.
Referenced by Grid(), isPointInGrid(), operator=(), and operator==().
      
  | 
  private | 
Number of rows.
Definition at line 290 of file Grid.h.
Referenced by Grid(), isPointInGrid(), operator=(), and operator==().
      
  | 
  private | 
The associated SRS.
Definition at line 291 of file Grid.h.
Referenced by operator=(), and operator==().