BIT2POLY

Converts a bitmap to polygons


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

Back to top

Description


BIT2POLY creates a whole polygon layer from a bitmap segment.
Back to top

Parameters


bit2poly(fili, dbib, filo, smoothv, dbsd, ftype, foptions)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
DBIB * List[int] Input bitmap segment 1 - 1  
FILO * str Output file name 1 -    
SMOOTHV str Smooth vectors 0 - 3 YES | NO
Default: YES
DBSD str Output segment description 0 - 64  
FTYPE str Output file type 0 - 4 See Parameter Details.
Default: PIX
FOPTIONS str Output file options 0 - 64  

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the GDB file that contains the bitmap segment to convert.

DBIB

Specifies the bitmap segment in the input file from which polygons are constructed.

FILO

Specifies the name of the GDB vector file that will contain the output line segment.

SMOOTHV

Specifies whether or not the vector data will be smoothed (corners rounded).

If SMOOTHV is set to YES, the polygon boundaries will be smoothed. If this parameter is set to NO, the created polygons will follow the pixel edges exactly.

DBSD

Describes (in up to 64 characters) the contents or origins of the output data. If this parameter is not 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: New segment number

Type:  PCI_INT

Parameter: LASC

This function returns the number of the newly created segment.

Back to top

Details

BIT2POLY creates a whole polygon layer from an input bitmap segment. Each contiguous region of on pixels (i.e. values of 1) will be grouped together into a single polygon. Only pixels with a value of 1 in the input bitmap result in polygons in the output.

The input bitmap (DBIB) is a segment number; the output segment description (DBSD) is used if specified; otherwise a default of "Polygon Layer" will be applied.

Back to top

Example

Build a whole polgon layer based on the bitmap segment 11 in irvine.pix and save the result to oirvine.pix. The polygon layer's description of "Polygons from Urban bitmap" is provided.

from pci.bit2poly import bit2poly

fili     = "irvine.pix"                    # input bitmap file
dbib     = [11]                            # input bitmap layer
filo     = "oirvine.pix"                   # output file to be created
smoothv  = "NO"                            # edges are not smoothed
dbsd     = "Polygons from Urban bitmap"    # output layer description
ftype    = ""                              # defaults to PIX
foptions = ""                              # output format options

bit2poly( fili, dbib, filo, smoothv, dbsd, ftype, foptions )
			

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