|
GEOS 3.15.0dev
|
The Grid class represents a grid of constant-size rectangular cells that covers a specified envelope. The width of the cells may be different from the height. If the Grid has an "infinite" extent rather than a "bounded" extent, then an extra row and column will be added on all side of the grid. The size of the cells in these columns may be larger than those in the primary grid, such that the extended grid covers a "domain" that is larger than the extent of the regular grid. More...
#include <Grid.h>
Public Member Functions | |
| Grid (const geom::Envelope &extent, double dx, double dy) | |
| Construct a bounded grid covering a specified extent. | |
| Grid (const geom::Envelope &extent, double dx, double dy, const geom::Envelope &domain) | |
| size_t | getColumn (double x) const |
| Get the column in which the specified x coordinate would fall. | |
| size_t | getRow (double y) const |
| Get the row in which the specified y coordinate would fall. | |
| std::size_t | getCell (double x, double y) const |
| bool | isEmpty () const |
| size_t | getNumRows () const |
| size_t | getNumCols () const |
| size_t | getSize () const |
| double | xmin () const |
| double | xmax () const |
| double | ymin () const |
| double | ymax () const |
| double | dx () const |
| double | dy () const |
| const geom::Envelope & | getExtent () const |
| size_t | getRowOffset (const Grid &other) const |
| size_t | getColOffset (const Grid &other) const |
| double | getColX (size_t col) const |
| Get the x coordinate at the center of the specified column. | |
| double | getRowY (size_t row) const |
| Get the y coordinate at the center of the specified row. | |
| Grid | crop (const geom::Envelope &e) const |
| Grid< extent_tag > | shrinkToFit (const geom::Envelope &b, bool calcExtentFromNewGrid=true) const |
| bool | operator== (const Grid< extent_tag > &b) const |
| bool | operator!= (const Grid< extent_tag > &b) const |
| geom::Envelope | getCellEnvelope (size_t row, size_t col) const |
Static Public Member Functions | |
| static Grid | makeEmpty () |
Friends | |
| Grid< infinite_extent > | make_infinite (const Grid< bounded_extent > &, const geom::Envelope &) |
| Grid< bounded_extent > | make_finite (const Grid< infinite_extent > &) |
The Grid class represents a grid of constant-size rectangular cells that covers a specified envelope. The width of the cells may be different from the height. If the Grid has an "infinite" extent rather than a "bounded" extent, then an extra row and column will be added on all side of the grid. The size of the cells in these columns may be larger than those in the primary grid, such that the extended grid covers a "domain" that is larger than the extent of the regular grid.
|
inline |
Construct an infinite grid covering a specified extent with regularly-sized cells, and adding a row and column of variably-sized cells to each edge of the primary grid such that the specified domain is covered.
|
inline |
Get the cell index in which the specified x and y values would fall. Cells are indexed from left-to-right, then top-to-bottom.
|
inline |
Return the number of columns by which another grid is offset from this Grid. It is assumed that the two grids have the same resolution, and that the minimum x value of the other grid is greater than or equal to the minimum x value of this grid.
References geos::geom::Envelope::getMinX().
|
inline |
Return the number of rows by which another grid is offset from this Grid. It is assumed that the two grids have the same resolution, and that the maximum y value of the other grid is less than or equal to the maximum y value of this grid.
References geos::geom::Envelope::getMaxY().
|
inline |
Reduce the size of the grid to contain only the provided Envelope If calcExtentFromNewGrid is true, then the xmax and ymin of the new grid will be calculated relative to the origin point of the original grid rather than the newly cropped grid.
References geos::geom::Envelope::getArea(), geos::geom::Envelope::getHeight(), geos::geom::Envelope::getMaxX(), geos::geom::Envelope::getMaxY(), geos::geom::Envelope::getMinX(), geos::geom::Envelope::getMinY(), and geos::geom::Envelope::getWidth().