Segments to polygons

Command line

The Segment to polygons operation can be directly executed by typing one of the following expressions on the command line of the Main window:

 

OUTMAP

=

PolygonMapFromSegment(InputSegmentMap)

OUTMAP

=

PolygonMapFromSegment(InputSegmentMap, "mask")

OUTMAP

=

PolygonMapFromSegment(InputSegmentMap, "mask", MethodTopo)

OUTMAP

=

PolygonMapFromSegment(InputSegmentMap, "mask", MethodTopo, Auto)

OUTMAP

=

PolygonMapFromSegment(InputSegmentMap, , MethodTopo)

OUTMAP

=

PolygonMapFromSegment(InputSegmentMap, , MethodTopo, Auto)

 

OUTMAP

=

PolygonMapFromSegmentNonTopo(InputSegmentMap)

OUTMAP

=

PolygonMapFromSegmentNonTopo(InputSegmentMap, "mask")

OUTMAP

=

PolygonMapFromSegmentNonTopo(InputSegmentMap, "mask", MethodNonTopo)

OUTMAP

=

PolygonMapFromSegmentNonTopo(InputSegmentMap, , MethodNonTopo)

where:

OUTMAP

is the name of your output polygon map.

PolygonMapFromSegment

topological polygonization: the command to start the Segments to Polygons operation if the segment structure is topological,
i.e. when segments can be used both to define the boundary between a polyon to its left and a polygon to its right.

PolygonMapFromSegmentNonTopo

non-topological polygonization: the command to start the Segments to Polygons operation if the segment structure is non-topological,
i.e. when each segment has only 1 node (serving both as begin node and as end node), and when each segment encloses exactly 1 polygon. Neighbouring polygons thus do not share the same segment as their boundary.
i.e. when each polygon is enclosed by 1 closed segment only.

InputSegmentMapName

is the name of your input segment map.

"mask"

is an optional parameter to specify the (multiple) search strings to find the classes, IDs or values in the input segment map so that only these segments will be used for polygonization; in a mask, asterisks and question marks can be used as wild cards; the total mask needs to be surrounded by double quotes.

If an empty mask is specified, as "", or if no mask is specified, all segments will be polygonized.

MethodTopo

LabelPntMap | unique | domain

is an optional parameter to specify how the polygons should be named during topological polygonization; parameters are explained below. If MethodTopo is not specified, the Unique method will be used.

LabelPntMap

is the name of the point map which contains the labels; polygons will be named according to these labels.

unique

parameter to specify that polygons should obtain unique IDs as Pol 1, Pol 2 etc. (internal domain).

domain

this option is mainly used when the Domain option is selected during polygonization in the Segment editor (see Segment editor : Polygonize). Domain is the name of an existing domain which should be linked to the output polygon map. In the output polygon map, the polygons will not have names yet; after polygonization, you need to assign names to the polygons manually, i.e. edit the polygon map.

MethodNonTopo

segments | LabelPntMap | unique | domain

is an optional parameter to specify how the polygons should be named during non-topological polygonization, parameters are explained below. If MethodNonTopo is not specified, the Unique method will be used.

segments

is the parameter to specify that each polygon should be named according to the code of the segment which encloses the polygon.

LabelPntMap

see above.

unique

see above.

domain

see above.

Auto

only for topological polygonization: optional parameter to automatically correct erroneous segments in the input map: deletes false polygons, deletes segments with dead ends, insert nodes when needed. If this parameter is not specified, polygonization will stop when an error is encountered in the input segment map.

When the definition symbol = is used, a dependent output map is created; when the assignment symbol := is used, the dependency link is immediately broken after the output map has been calculated.

Furthermore, when the Unique method is used, the names for the output polygons will be stored by the output polygon map, i.e. the output map will use a UniqueID domain (internal domain).

Examples topological polygonization:

POLMAP1 = PolygonMapFromSegment(MySegMap, , MyLabels)

All segments in segment map MySegMap will be polygonized and polygons will be named according to the label points in point map MyLabels. The output polygon map will be called POLMAP1.

 

POLMAP2 = PolygonMapFromSegment(MySegMap, "Land*", MyLabels)

From segment map MySegMap, segments which have a code that starts with Land will be polygonized and polygons will be named according to the label points in point map MyLabels. The output polygon map will be called POLMAP2.

Example non-topological polygonization:

POLMAP3 = PolygonMapFromSegmentNonTopo(MySegMap, , segments)

All segments in segment map MySegMap will be polygonized and each polygon will be named according the name of the segment which encloses the polygon. The output polygon map will be called POLMAP3.

See also: