THMR2RAS

Thematic raster to raster


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

Back to top

Description


THMR2RAS converts a thematic raster to a raster.
Back to top

Parameters


Name Type Caption Length Value range
FILI * String Input file name 1 - 192  
DBIC * Integer Input raster channel 1 - 1  
FILO * String Output file name 1 - 192  
DBOC Integer Output raster channel 0 - 1  
FLDNME * String Attribute field name 1 - 64  
FTYPE String Output file type 0 - 4 Default: PIX
FOPTIONS String Output file options 0 - 64  
MONITOR String Monitor mode 0 - 3 ON, OFF
Default: ON

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the file that contains the thematic raster data to be converted into the raster channel.

DBIC

Specifies the channel of thematic raster data to convert.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

FILO

Specifies the name of the file to hold the output converted raster channel.

If FILO is specified but does not exist, a new PCIDSK file or GDB-supported file will be created.

DBOC

Specifies the output channel to which the converted raster is written. The pixel values for this raster are based on the selected attribute from the input thematic layer. If this parameter is not specified, output is sent to a new channel.

If FILO is an existing file, this parameter may be left unspecified; THMR2RAS will create a new channel in the most logical position. If DBOC specifies an existing channel, the function will overwrite that channel. A message will appear, warning the user that information may be lost, particularly when writing data from a 16- or 32-bit channel to an 8-bit channel. If DBOC specifies a channel that does not yet exist, even if it is the next channel in the sequence (the channel that would be created if DBOC was left blank), an error message appears.

If FILO specifies a file that does not already exist, DBOC should be left unspecified or set to 1. A value greater than 1 will cause the function to error.

DBOC cannot be the same as DBIC. DBOC should have a sufficiently large data type to accept values from DBIC, otherwise truncation will occur. For example, if DBIC attribute values range from 0 to 10,000, an 8-bit DBOC results in loss of data, while a 16-bit DBOC is sufficient.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

FLDNME

Specifies the name of the attribute field to use when encoding the new raster layer.

The attribute must be numeric, as these values are written as pixel values in the output raster channel. The attribute name is not case-sensitive.

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.

MONITOR

The program progress can be monitored by printing the percentage of processing completed. A system parameter, MONITOR, controls this activity.

Available options are:

Back to top

Details

THMR2RAS converts the thematic raster to a raster by encoding each pixel with a value based on a selected attribute. The attribute must be a numeric data type.

A thematic raster is a raster with associated attributes. Normally, rasters present spatial information as pixel values. Thematic rasters have an associated attribute table that can store more information than just a pixel value. In some cases, you may want to use THMR2RAS to convert a thematic raster to a regular raster. You specify an existing attribute to provide the pixel values to burn into the output raster and the information from the rest of the attributes is not part of the output layer.

Back to top

Example

The file RasRain.pix is a thematic raster representing percipitation levels in California. The amount of rain has been categorized into four groups as stored in the Weight attribute. THMR2RAS will be used to create a new raster that has pixel values set via that Weight attribute.

EASI>FILI     = "RasRain.pix"       ! input thematic raster file
EASI>DBIC     = 1                   ! input channel
EASI>FILO     = "RainWeight.pix"    ! raster file to be created
EASI>DBOC     =                     ! a new channel will be created in RainWeight.pix
EASI>FLDNME   = "Weight"            ! encode the attribute "Weight"
EASI>FTYPE    =                     ! defaults to PIX
EASI>FOPTIONS = "RLE"               ! Run Length Encode the output

EASI>run thmr2ras
            

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