GEOS 3.15.0dev
|
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>
Public Member Functions | |
GridIntersection (const Grid< bounded_extent > &raster_grid, const geom::Geometry &g, 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, 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. | |
Static Public Member Functions | |
static std::unique_ptr< geom::Geometry > | subdividePolygon (const Grid< bounded_extent > &p_grid, const geom::Geometry &g, bool includeExterior) |
Partition a polygonal geometry by a grid. | |
static std::shared_ptr< Matrix< float > > | getIntersectionFractions (const Grid< bounded_extent > &raster_grid, const geom::Geometry &g) |
static std::shared_ptr< Matrix< float > > | getIntersectionFractions (const Grid< bounded_extent > &raster_grid, const geom::Envelope &box) |
static geom::Envelope | processingRegion (const geom::Envelope &raster_extent, const geom::Geometry &geometry) |
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. | |
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.
|
static |
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.
raster_extent | Envelope representing the extent of the vector |
geometry | Geometry to be processed |
raster_extent
that intersects one or more component_boxes