POLY2LINE

Converts polygons to lines


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example

Back to top

Description


POLY2LINE converts a polygon layer to a line layer.
Back to top

Parameters


poly2line(fili, dbvs, filo, dbsd, ftype, foptions)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
DBVS * List[int] Input polygon layer 1 - 1  
FILO * str Output file name 1 -    
DBSD str Output segment descriptor 0 - 64
Default: 
FTYPE str Output file type 0 - 4 Default: PIX
FOPTIONS str Output file options 0 - 64  

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the file that contains the input vector segment to be processed.

DBVS

Specifies the input segment containing the polygon vectors from which the line layer will be created. The input vector layer can either be whole polygons or topological polygons.

FILO

Specifies the output file name.

DBSD

Specifies a descriptor for the output line segment. Descriptor may be up to 64 characters long. When nothing is specified a default description is generated.

FTYPE

Optionally specifies the output file format type, represented by a three- or four-letter code. The format type must be a GDB-recognized file type. If FILO specifies an existing file, FTYPE should not be specified since the existing file will be updated and its type won't be changed.

Supported file format codes include: The default value is PIX.

For a complete list of GDB-recognized file types and their codes, see GDB file formats in the Technical Reference section of the CATALYST Professional online Help.

FOPTIONS

Optionally specifies the file creation options to be applied when creating the output file. These are specific to the file format; in each case, the default of no options is allowed. FOPTIONS can be used to specify the compression schemes, file format subtypes, and other information.

Different options are available for different file types (see the FTYPE parameter). The options are described in GDB file formats in the Technical Reference section of the CATALYST Professional online Help.

For PIX format, FOPTIONS defaults to BAND.

Back to top

Return Value

Returns: execution status

Type:  PCI_INT

The last segment created is stored in LASC.

Back to top

Details

POLY2LINE creates a line layer from a polygon layer. All of the edges of the polygons are convereted to lines with all vertices being preserved.

Back to top

Example

A line segment is built based on the polygon segment 31 in irvine.pix and is also saved to irvine.pix.

from pci.poly2line import poly2line

fili        = "irvine.pix"     # input polygon file
dbvs        = [31]             # polygon layer
filo        = "irvine.pix"     # output file
dbsd        = ""               # use default
ftype       = ""               # blank because output file exists
foptions    = ""               # blank because output file exists

vec_seg = poly2line(fili, dbvs, filo, dbsd, ftype, foptions)
			

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.