| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example :: Related |
| Back to top |
| Back to top |
ras2bit(fili, dbic, filo, 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 - | |
| DBSD | str | Output segment descriptor | 0 - 64 | |
| FTYPE | str | Output file type | 0 - 4 | |
| FOPTIONS | str | Output file options | 0 - 64 |
| Back to top |
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 bitmap layer will be saved. This file is created if it does not already exist.
DBSD
Specifies a descriptor for the output bitmap segment. Descriptor may be up to 64 characters long.
If not specified then the descriptor from the input channel is copied to the output bitmap.
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.
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 |
Returns:
Type: PCI_INT
| Back to top |
RAS2BIT converts a raster layer to a 1-bit bitmap layer. The output bitmap is created for all valid pixels. Valid pixels are assigned a 1 in the bitmap, and pixels with a NoData value are assigned a 0. A raster without a NoData value produces a bitmap of the full raster.
| Back to top |
Raster in L7_ms.pix is converted to a newly created bitmap segment in a new file, RAS2BIT.pix.
from pci.ras2bit import ras2bit fili = "L7_ms.pix" # input raster file dbic = [7] # input raster layer filo = "RAS2BIT.pix" # output file to be created dbsd = "" # default, based on input ftype = "" # defaults to PCIDSK foptions = "" # output format options bit_seg = ras2bit( fili, dbic, filo, dbsd, ftype, foptions )
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.