GEOS
3.14.0dev
|
Polygonizes a set of Geometrys which contain linework that represents the edges of a planar graph. More...
#include <Polygonizer.h>
Public Member Functions | |
Polygonizer (bool onlyPolygonal=false) | |
Create a Polygonizer with the same GeometryFactory as the input Geometrys. More... | |
void | add (std::vector< geom::Geometry * > *geomList) |
Add a collection of geometries to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used. More... | |
void | add (std::vector< const geom::Geometry * > *geomList) |
Add a collection of geometries to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used. More... | |
void | add (const geom::Geometry *g) |
std::vector< std::unique_ptr< geom::Polygon > > | getPolygons () |
Gets the list of polygons formed by the polygonization. More... | |
const std::vector< const geom::LineString * > & | getDangles () |
Get the list of dangling lines found during polygonization. More... | |
bool | hasDangles () |
const std::vector< const geom::LineString * > & | getCutEdges () |
Get the list of cut edges found during polygonization. More... | |
bool | hasCutEdges () |
const std::vector< std::unique_ptr< geom::LineString > > & | getInvalidRingLines () |
Get the list of lines forming invalid rings found during polygonization. More... | |
bool | hasInvalidRingLines () |
bool | allInputsFormPolygons () |
Protected Attributes | |
std::unique_ptr< PolygonizeGraph > | graph |
std::vector< const geom::LineString * > | dangles |
std::vector< const geom::LineString * > | cutEdges |
std::vector< std::unique_ptr< geom::LineString > > | invalidRingLines |
std::vector< EdgeRing * > | holeList |
std::vector< EdgeRing * > | shellList |
std::vector< std::unique_ptr< geom::Polygon > > | polyList |
Friends | |
class | Polygonizer::LineStringAdder |
Polygonizes a set of Geometrys which contain linework that represents the edges of a planar graph.
All types of Geometry are accepted as input; the constituent linework is extracted as the edges to be polygonized. The edges must be correctly noded; that is, they must only meet at their endpoints. Polygonization will accept incorrectly noded input but will not form polygons from non-noded edges, and reports them as errors.
The Polygonizer reports the follow kinds of errors:
Invalid Ring Lines - edges which form rings which are invalid (e.g. the component lines contain a self-intersection)
The Polygonizer constructor allows extracting only polygons which form a valid polygonal result. The set of extracted polygons is guaranteed to be edge-disjoint. This is useful when it is known that the input lines form a valid polygonal geometry (which may include holes or nested polygons).
|
explicit |
Create a Polygonizer with the same GeometryFactory as the input Geometrys.
onlyPolygonal | true if only polygons which form a valid polygonal geometry should be extracted |
void geos::operation::polygonize::Polygonizer::add | ( | const geom::Geometry * | g | ) |
Add a geometry to the linework to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used
g | a Geometry with linework to be polygonized |
void geos::operation::polygonize::Polygonizer::add | ( | std::vector< const geom::Geometry * > * | geomList | ) |
Add a collection of geometries to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used.
geomList | a list of Geometry with linework to be polygonized |
void geos::operation::polygonize::Polygonizer::add | ( | std::vector< geom::Geometry * > * | geomList | ) |
Add a collection of geometries to be polygonized. May be called multiple times. Any dimension of Geometry may be added; the constituent linework will be extracted and used.
geomList | a list of Geometry with linework to be polygonized |
const std::vector<const geom::LineString*>& geos::operation::polygonize::Polygonizer::getCutEdges | ( | ) |
Get the list of cut edges found during polygonization.
const std::vector<const geom::LineString*>& geos::operation::polygonize::Polygonizer::getDangles | ( | ) |
Get the list of dangling lines found during polygonization.
const std::vector<std::unique_ptr<geom::LineString> >& geos::operation::polygonize::Polygonizer::getInvalidRingLines | ( | ) |
Get the list of lines forming invalid rings found during polygonization.
std::vector<std::unique_ptr<geom::Polygon> > geos::operation::polygonize::Polygonizer::getPolygons | ( | ) |
Gets the list of polygons formed by the polygonization.
Ownership of vector is transferred to caller, subsequent calls will return NULL.