User Tools

Site Tools


api:dk11:delphi:gisclassification.tgis_reclassification

TGIS_Reclassification class

DK11 for Delphi | GisClassification.TGIS_Reclassification | Classes | Constructors | Methods | Properties | Events

A class that allows reclassification of grid layer values.

Available also on: .NET | Java | ActiveX | Python.

Syntax

// Delphi
type
  TGIS_Reclassification = class( TGIS_Object )
  end;
// C++ Builder
class PASCALIMPLEMENTATION TGIS_Reclassification : public TGIS_Object
{
};

Inheritance

Constructors

Inherited Overrides Protected
Name Visibility Description
Create public Initializes a new instance of the TGIS_Reclassification class.

Methods

Inherited Overrides Protected
Name Visibility Description
AddReclassRange(Single; Single; Single) public Adds a new reclassification range definition.
AddReclassRange(Single; Single; Single; TGIS_Color) public Adds a new reclassification range definition.
AddReclassValue(Single; Single) public Adds a new reclassification value definition.
AddReclassValue(Single; Single; TGIS_Color) public Adds a new reclassification value definition.
ClearReclassDefinitions public Clears all reclassification definitions (ranges & values).
Generate public Fiils the _destination grid layer with reclassified values.

Properties

Inherited Protected
Name Visibility Description
ReclassNoDataValue public The new value to be assigned to the input NoData value.
UseNoDataForMissingValues public Indicates whether cell values outside the defined ranges are reclassified to NoData (true by default), or remain intact (false).

Events

Inherited Protected
Name Visibility Description
BusyEvent published

Remarks

What is Grid Reclassification?

Grid reclassification is the process of reassigning values in a raster dataset based on specified criteria. It is commonly used to simplify or categorize data, such as converting a continuous range of elevation values into distinct altitude zones. This technique is invaluable for various analyses, including environmental monitoring, land use planning, and risk assessment.

Key features of the Reclassification tool

  1. Range-based reclassification
    Define new values for ranges of input values. This is useful for transforming continuous data into discrete classes. For adding a new reclassification range definition, use the AddReclassRange method with defined a lower (inclusive) and an upper (exclusive) bound of the range, a new value for the range, and optionally color to represent the new value.
  2. Value-based reclassification
    Directly map specific input values to new values, allowing for precise control over reclassification. For adding a new reclassification value definition, use the AddReclassValue method with defined an old value from the source layer to be reclassified, a new value to be assigned to the input value, and optionally color to represent the new value.
  3. Handling missing values
    Manage cells that fall outside defined reclassification ranges by reclassifying them as NoData, or by leaving them unchanged. This is controlled by the UseNoDataForMissingValues property.
  4. Handling NoData values
    ReclassNoDataValue property allows the definition of the new value to be assigned to the input NoData value.
  5. Reclassification execution
    Apply your reclassification definitions to a source grid layer and generate an output layer using Generate method

Using the _useAltitudeMapZones parameter

The _useAltitudeMapZones parameter in the Generate method allows you to specify whether the reclassification should be based on predefined reclass definitions or altitude map zones defined in the TGIS_LayerPixel.Params.Pixel.AltitudeMapZones property.

By setting _useAltitudeMapZones to True, the tool will utilize altitude zones instead of the reclass ranges and values you may have defined. This can be particularly useful when working with elevation data already segmented into meaningful zones. However, it's important to note that enabling this option will delete any existing reclassification definitions, as the process will rely solely on the altitude map zones.

The class will try to assign new values from the legend part of the altitude map zones only if they are all integer values, otherwise it will assign new values starting from 0.

How to use the TGIS_Reclassification class

// Create an instance of TGIS_Reclassification
Reclassifier = TGIS_Reclassification.Create;  
 
// Define reclassification ranges or values
reclass.AddReclassRange(0.0, 100.0, 1.0, TGIS_Color.Red);  
reclass.AddReclassValue(150.0, 2.0, TGIS_Color.Blue);  
 
// Set NoData handling
reclass.UseNoDataForMissingValues := True; 
reclass.ReclassNoDataValue := -9999.0;  
 
// Apply Reclassification based on the reclassification definitions
reclass.Generate(sourceLayer, extent, destinationLayer);  
 
// Or using altitude map zones
reclass.Generate(sourceLayer, extent, destinationLayer, True);  

The Reclassification tool is also available in TatukGIS Pipelines

Reclassification

References

2024/06/07 01:12

Page Tools