GEOS 3.15.0dev
Public Member Functions | List of all members
geos::operation::grid::Cell Class Reference

The Cell class stores information about the spatial extent of a Grid cell and any cases where a line crosses that cell (recorded in a Traversal). More...

#include <Cell.h>

Public Member Functions

 Cell (double xmin, double ymin, double xmax, double ymax)
 
 Cell (const geom::Envelope &b)
 
const geom::Envelopebox () const
 
double getWidth () const
 
double getHeight () const
 
double getArea () const
 
void forceExit ()
 
bool isDetermined () const
 
double getTraversalLength () const
 Return the total length of a linear geometry within this Cell.
 
double getCoveredFraction () const
 Return the fraction of this Cell that is covered by a polygon.
 
std::unique_ptr< geom::GeometrygetCoveredPolygons (const geom::GeometryFactory &) const
 
TraversalgetLastTraversal ()
 
bool take (const geom::CoordinateXY &c, const geom::CoordinateXY *prev_original=nullptr)
 

Detailed Description

The Cell class stores information about the spatial extent of a Grid cell and any cases where a line crosses that cell (recorded in a Traversal).

Member Function Documentation

◆ forceExit()

void geos::operation::grid::Cell::forceExit ( )

Force the last Coordinate processed (via take) to be considered as an exit point, provided that it lies on the boundary of this Cell.

◆ getCoveredPolygons()

std::unique_ptr< geom::Geometry > geos::operation::grid::Cell::getCoveredPolygons ( const geom::GeometryFactory ) const

Return a newly constructed geometry representing the portion of this Cell that is covered by a polygon

◆ getLastTraversal()

Traversal & geos::operation::grid::Cell::getLastTraversal ( )

Return the last (most recent) traversal to which a coordinate has been added. The traversal may or may not be completed.

◆ isDetermined()

bool geos::operation::grid::Cell::isDetermined ( ) const

Returns whether the cell can be determined to be wholly or partially covered by a polygon.

◆ take()

bool geos::operation::grid::Cell::take ( const geom::CoordinateXY &  c,
const geom::CoordinateXY *  prev_original = nullptr 
)

Attempt to take a coordinate and add it to a Traversal in progress, or start a new Traversal

Parameters
cCoordinate to process
prev_originalThe last uninterpolated coordinate preceding c in the boundary being processed
Returns
true if the Coordinate was inside this cell, false otherwise

The documentation for this class was generated from the following file: