| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: Related |
| Back to top |
| Back to top |
speclass(fili, filedem, dbec, filo, ftype, foptions, options)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI * | str | Input image | 1 - | |
| FILEDEM | str | Elevation file name | 0 - | |
| DBEC | List[int] | Elevation channel or layer | 0 - 1 | |
| FILO * | str | Spectral classification | 1 - | |
| FTYPE | str | Output file type | 0 - 4 | |
| FOPTIONS | str | Output file options | 0 - 64 | |
| OPTIONS | str | Processing options | 0 - 64 |
| Back to top |
FILI
The name of the input image from a supported sensor.
Input file must contain at least red, green and NIR spectral channels. It has to contain enough metadata information to convert data to TOA reflectance.
FILEDEM
Specifies the file that contains the elevation (DEM) layer. The elevation file is optional.
DBEC
Specifies the elevation layer. The default is to take the first layer containing elevation data
FILO
The name of the output file to which to write the computed spectral classification. The file name you specify must not already exist. The output file will contain one 8-bit unsigned channel.
FTYPE
The format of the output file. The format must be a GDB-supported type.
If this parameter is not specified then FILO extension is used, if supported. PIX is used for files without extension.
FOPTIONS
The options to use when creating the output file, which are specific to each format. For example, with some formats, you can select compression schemes, subtypes, and more.
If compression is used it must be lossless.
This parameter is optional; that is, you need not specify any options.
For a complete list of GDB-recognized file types, including the available options for each, see GDB-supported file formats.
OPTIONS
The options to use when running the SPECLASS function.
| Back to top |
The algorithm is based on rules that use spectral indices and features derived from spectral bands. These features are calculated for a multitude of sensors and normalized so that a cross sensor comparison of features becomes possible.
Spectral bands are converted to TOA reflectance values on-the-fly, using the nominal solar zenith angle. Those values are used to calculate indices and features like tasseled cap indices, NDVI, HOT, MNDWI, and others.
Various levels of classification are processed based on the available number of bands. At a minimum, red, green and NIR bands must be available.
At the first classification level, only basic features can be derived, and a limited number of classes can be extracted, such as clouds, water and shadow, vegetation and bare ground.
At the second level of classification, a SWIR band is required, and basic classes are subdivided into subclasses, such as thick or thin clouds; snow; turbid, green, shallow or deep water; various types of active and senescent vegetation, and so forth.
The last level uses a cirrus band, if available, to extract a high-cloud class.
SPECLASS can be used for the generation of a general quality layer to guide further radiometric and geometric processing. The resulting cloud and water masks can be used for targeted ground control point and tie point collection leading to better image triangulation. In the same way it may improve the extraction and automatic filtering of extracted surface models filling water bodies with a constant elevation, ignoring clouds and filtering heavily in shadow. Using the cloud and water mask for the avoidance of dodging points in color balancing will lead to better mosaics.
The output from SPECLASS can be recoded to fulfill the requirements of a class layer for topographic normalization such as TOPOSOLNORM.
The possible output classes are as follows:
| Class Name | Description | Pixel Value |
|---|---|---|
| NO_Data | no data value | 0 |
| Invalid_data | invalid data | 1 |
| Cloud | cloud master class | 10 |
| Cloud_thick | thick clouds | 12 |
| Cloud_cirrus | clouds detected in the cirrus band | 14 |
| Cloud_thin | semi transparent clouds | 16 |
| Shadow_and_Water | master class of dark area that could be shadow or water | 20 |
| Shadow_cloud | shadow introduced by cloud | 24 |
| Shadow_topographic_full | fully shaded area introduced by topography | 26 |
| Shadow_other | shaded areas or water not attributed to cloud or topography | 28 |
| Snow | snow master class | 30 |
| Water | water master class with a very low SWIR signal | 40 |
| Water_deep | deep water | 42 |
| Water_green | water with algae / aquatic vegetation | 44 |
| Water_turbid | turbid water with suspended particles | 46 |
| Water_shallow | shallow water with signal from the bottom substrate | 48 |
| Bare | bare land surfaces with no vegetation master class | 50 |
| Bare_bright_soil | bare bright soil | 52 |
| Bare_red_soil | bare red soil | 54 |
| Bare_dark_soil | bare dark soil | 56 |
| Bare_burnt_area | bare burnt area with a high SWIR signal | 58 |
| Vegetation | vegetation master class with weak to strong vegetation response | 60 |
| Vegetation_senescent | senescent vegetation master class of either dark or bright areas | 70 |
| Vegetation_senescent_dark | dark senescent vegetation | 72 |
| Vegetation_senescent_bright | bright senescent vegetation | 74 |
| Vegetation_active | actively growing vegetation master class | 80 |
| Vegetation_active_woody_conifer | woody actively growing vegetation | 90 |
| Vegetation_active_woody_conifer | conifer actively growing trees | 92 |
| Vegetation_active_woody_broadleaved | broad leaved actively growing shrubs and trees | 96 |
| Vegetation_active_herbaceous | actively growing herbaceous vegetation | 100 |
| Back to top |
Calculate a spectral classification based on Sentinel-2 image: S2A_MSIL1C_20171001T020441_N0205_R017_T51LXJ_20171001T020829.pix
from pci.speclass import speclass
fili = "S2A_MSIL1C_20171001T020441_N0205_R017_T51LXJ_20171001T020829.pix"
fildem = "DEM_REP.pix"
dbec = []
filo = "S2A_spectral_classification.pix"
ftype = ""
foption = ""
options = ""
speclass(fili, fildem, dbec, filo, ftype, foption, options)
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.