RAS2LINE

Convert a raster to lines


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

Back to top

Description


RAS2LINE converts a raster layer to a line layer.
Back to top

Parameters


ras2line(fili, dbic, filo, remedge, smoothv, dbsd, ftype, foptions)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
DBIC * List[int] Input raster channel 1 - 1  
FILO * str Output file name 1 -    
REMEDGE str Remove outside perimeter edges from the raster 0 - 3 YES | NO
Default: NO
SMOOTHV str Smooth vectors 0 - 3 YES | NO
Default: YES
DBSD str Output segment description 0 - 64  
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 file that contains the input raster channel to be processed.

DBIC

Specifies the input raster channel to be processed.

FILO

Specifies the name of the file to which the new line layer will be saved. This file is created if it does not already exist.

REMEDGE

Specifies whether remove the outside edges (bounds) of the raster.

If YES (selected), lines are removed from the bounds of the raster when converting to lines. If NO (cleared), lines are created for the entire extents of the raster; this is the default value.

SMOOTHV

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

If SMOOTHV is set to YES, the vector lines will be smoothed. If this parameter is set to NO, the created vector lines 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.

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

RAS2LINE creates a line layer from an input raster channel. Each contiguous region of equal-valued pixels will be grouped together with lines being created around its edge. The function also provides the option of removing lines from the input raster's bounding box.

Back to top

Example

Create a line layer based on channel 6 in irvine.pix and save the output vector to a new file, irv6lines.shp. The output layer has a description of "Created From Raster".

from pci.ras2line import ras2line

fili     = "Irvine.pix"       # input raster file
dbic     = [6]                # input raster layer
filo     = "irv6lines.shp"    # output file to be created
remedge  = ""                 # default, NO lines on the edge not removed
smoothv  = ""                 # default, YES lines are smoothed
dbsd     = ""                 # output segment description
ftype    = "SHP"              # output format type
foptions = ""                 # output format options

ras2line(fili, dbic, filo, remedge, smoothv, dbsd, ftype, foptions)

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