The GridIntersection class computes and stores information about intersection of a Grid and a Geometry. For a polygonal geometry, the fraction of each grid cell covered by polygon is stored. For a linear geometry, the length of the line in each grid cell is stored.
More...
#include <GridIntersection.h>
|
|
| GridIntersection (const Grid< bounded_extent > &raster_grid, const geom::Geometry &g, const std::shared_ptr< Matrix< float > > &cov=nullptr) |
| | Compute the fraction of each cell in a rectangular grid that is covered by a Geometry. A matrix can be provided to which the fractions will be added.
|
| |
|
| GridIntersection (const Grid< bounded_extent > &raster_grid, const geom::Envelope &box, const std::shared_ptr< Matrix< float > > &cov=nullptr) |
| | Compute the fraction of each cell in a rectangular grid that is covered by an Envelope. A matrix can be provided to which the fractions will be added.
|
| |
|
std::shared_ptr< Matrix< float > > | getResults () |
| | Return the intersection result matrix.
|
| |
The GridIntersection class computes and stores information about intersection of a Grid and a Geometry. For a polygonal geometry, the fraction of each grid cell covered by polygon is stored. For a linear geometry, the length of the line in each grid cell is stored.
Intersection information returned as Raster with an equivalent resolution to the input Grid. The spatial extent may be reduced from the input Grid.
◆ getIntersectionFractions()
| static std::shared_ptr< Matrix< float > > geos::operation::grid::GridIntersection::getIntersectionFractions |
( |
const Grid< bounded_extent > & |
grid, |
|
|
const geom::Geometry & |
g |
|
) |
| |
|
static |
Calculate the fraction of each cell in a Grid that is covered by a polygon.
- Parameters
-
| grid | the Grid for which coverage fractions should be returned |
| g | a polygonal or linear geometry |
- Returns
- a matrix having the same number of rows and columns as the grid, whose values contain either the fraction of the cell area (for polygonal inputs) or the length of the intersection (for linear inputs)
◆ processingRegion()
Determines the bounding box of the raster-vector intersection. Considers the bounding boxes of individual polygon components separately to avoid unnecessary computation for sparse multi-polygons.
- Parameters
-
| raster_extent | Envelope representing the extent of the vector |
| geometry | Geometry to be processed |
- Returns
- the portion of
raster_extent that intersects one or more component_boxes
◆ subdividePolygon()
| static std::unique_ptr< geom::Geometry > geos::operation::grid::GridIntersection::subdividePolygon |
( |
const Grid< bounded_extent > & |
grid, |
|
|
const geom::Geometry & |
g, |
|
|
bool |
includeExterior |
|
) |
| |
|
static |
Partition a polygonal geometry by a grid.
- Parameters
-
| grid | the Grid by which the polygon should be partitioned. The Grid does not need to cover the polygon. |
| g | a polygonal geometry |
| includeExterior | whether the result should contain any portions of the input that fall outside the grid. |
- Returns
- a GeometryCollection containing the partitioned polygon.
The documentation for this class was generated from the following file: