GEOS  3.9.0dev
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 (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...

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< PolygonizeGraphgraph

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

## Detailed Description

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:

• Dangles - edges which have one or both ends which are not incident on another edge endpoint
• Cut Edges - edges which are connected at both ends but which do not form part of a polygon
• 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).

## Constructor & Destructor Documentation

 geos::operation::polygonize::Polygonizer::Polygonizer ( bool onlyPolygonal = `false` )
explicit

Create a Polygonizer with the same GeometryFactory as the input Geometrys.

Parameters
 onlyPolygonal true if only polygons which form a valid polygonal geometry should be extracted

## 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
 geomList a 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
 geomList a 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
 g a 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
 g a Geometry with linework to be polygonized
 const std::vector& 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& 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 >& 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 > 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:
{"ft_lang_label":"__label__en","ft_lang_prob":0.7299618,"math_prob":0.86352426,"size":5048,"snap":"2020-34-2020-40","text_gpt3_token_len":1210,"char_repetition_ratio":0.19131641,"word_repetition_ratio":0.5007299,"special_character_ratio":0.2284073,"punctuation_ratio":0.24707136,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9780741,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-23T13:52:49Z\",\"WARC-Record-ID\":\"<urn:uuid:073bcd28-4159-4a7a-9a0d-b1edc6425263>\",\"Content-Length\":\"26105\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:eb19dc77-6e2b-40e6-a364-c30c090bd26d>\",\"WARC-Concurrent-To\":\"<urn:uuid:3035b670-190e-498a-8a87-52d5f569c58c>\",\"WARC-IP-Address\":\"140.211.15.3\",\"WARC-Target-URI\":\"https://geos.osgeo.org/doxygen/classgeos_1_1operation_1_1polygonize_1_1Polygonizer.html\",\"WARC-Payload-Digest\":\"sha1:4FTJ3T6CZUWIZT7H3Z3YFXNTMH6EJEAZ\",\"WARC-Block-Digest\":\"sha1:EISFJEQUTZPAGKUBZPEQ2HSRWOPIPYQ2\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400210996.32_warc_CC-MAIN-20200923113029-20200923143029-00031.warc.gz\"}"}