GEOS  3.8.0dev
Public Member Functions | Protected Attributes | Friends | List of all members
geos::operation::polygonize::Polygonizer Class Reference

Polygonizes a set of Geometrys which contain linework that represents the edges of a planar graph. More...

#include <Polygonizer.h>

Public Member Functions

 Polygonizer ()
 Create a polygonizer with the same GeometryFactory as the input Geometry.
 
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 (geom::Geometry *g)
 
void add (const geom::Geometry *g)
 
std::vector< 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...
 
const std::vector< const
geom::LineString * > & 
getCutEdges ()
 Get the list of cut edges found during polygonization. More...
 
const std::vector
< geom::LineString * > & 
getInvalidRingLines ()
 Get the list of lines forming invalid rings found during polygonization. More...
 

Protected Attributes

PolygonizeGraphgraph
 
std::vector< const
geom::LineString * > 
dangles
 
std::vector< const
geom::LineString * > 
cutEdges
 
std::vector< geom::LineString * > invalidRingLines
 
std::vector< EdgeRing * > holeList
 
std::vector< EdgeRing * > shellList
 
std::vector< geom::Polygon * > * polyList
 

Friends

class Polygonizer::LineStringAdder
 

Detailed Description

Polygonizes a set of Geometrys which contain linework that represents the edges of a planar graph.

Any dimension of Geometry is handled - the constituent linework is extracted to form the edges. The edges must be correctly noded; that is, they must only meet at their endpoints. The Polygonizer will still run on incorrectly noded input but will not form polygons from incorrected noded edges.

The Polygonizer reports the follow kinds of errors:

Member Function Documentation

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.

Parameters
geomLista list of 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.

Parameters
geomLista list of Geometry with linework to be polygonized
void geos::operation::polygonize::Polygonizer::add ( 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

Parameters
ga Geometry with linework to be polygonized
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

Parameters
ga 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.

Returns
a (possibly empty) collection of pointers to the input LineStrings which are cut edges.
const std::vector<const geom::LineString*>& geos::operation::polygonize::Polygonizer::getDangles ( )

Get the list of dangling lines found during polygonization.

Returns
a (possibly empty) collection of pointers to the input LineStrings which are dangles.
const std::vector<geom::LineString*>& geos::operation::polygonize::Polygonizer::getInvalidRingLines ( )

Get the list of lines forming invalid rings found during polygonization.

Returns
a (possibly empty) collection of pointers to the input LineStrings which form invalid rings
std::vector<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.

Returns
a collection of Polygons

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