GBDX

ENVI® Color Slice Classification

This task creates a classification raster by thresholding on select data ranges and colors to highlight areas of a raster. By default, 16 classes are generated with the first 16 colors of the 'Rainbow' color table.

GBDX Registered Name: ENVI_ColorSliceClassification
Provider: Harris Geospatial Solutions

Imagery Examples

Before: WorldView 2 image after AOP correction

Before: WorldView 2 image after AOP correction

After: WorldView 2 image after color slice classification

After: WorldView 2 image after color slice classification

Quickstart

This is a workflow example for basic processing

# Quickstart Example running the task name.

# Initialize the Environment.
from os.path import join, split
from gbdxtools import Interface
gbdx = Interface()

tasks = []
output_location = 'ENVI/ColorSlice'

cat_id = '105001000672E000'

# Image Auto ordering task parameters
order = gbdx.Task("Auto_Ordering")
order.inputs.cat_id = cat_id
order.impersonation_allowed = True
order.persist = True
order.timeout = 36000
tasks += [order]

# Image AOP task parameters
aop = gbdx.Task("AOP_Strip_Processor")
aop.inputs.data = order.outputs.s3_location.value
aop.inputs.bands = 'MS'
aop.inputs.enable_dra = False
aop.outputs.data.persist = True
aop.outputs.data.persist_location = output_location+'/aop'
aop.timeout = 36000
tasks += [aop]

# Create an NDVI Product from the image
envi_ndvi = gbdx.Task("ENVI_SpectralIndex")
envi_ndvi.inputs.input_raster = aop.outputs.data.value
envi_ndvi.inputs.index = "Normalized Difference Vegetation Index"
tasks += [envi_ndvi]

# Create color slice raster
envi_color = gbdx.Task('ENVI_ColorSliceClassification')
envi_color.inputs.input_raster = envi_ndvi.outputs.output_raster_uri.value
envi_color.inputs.color_table_name = 'CB-RdYlGn'
envi_color.inputs.number_of_ranges = '15'
tasks += [envi_color]

workflow = gbdx.Workflow(tasks)
workflow.savedata(
    envi_color.outputs.output_raster_uri, location=output_location
)

workflow.execute()

Inputs

The following table lists all ENVI_ColorSliceClassification inputs.
Mandatory (optional) settings are listed as Required = True (Required = False).

Name Required Default Valid Values Description
file_types False N/A string GBDX Option. Comma seperated list of permitted file type extensions. Use this to filter input files -- Value Type: STRING[*]
input_raster True N/A See ENVIRASTER input type Specify a 1 band raster on which to perform color slice classification. -- Value Type: ENVIRASTER
input_raster_format False N/A See ENVIRASTER input type Provide the format of the image, for example: landsat-8. -- Value Type: STRING
input_raster_band_grouping False N/A See ENVIRASTER input type Provide the name of the band grouping to be used in the task, ie - panchromatic. -- Value Type: STRING
input_raster_filename False N/A See ENVIRASTER input type Provide the explicit relative raster filename that ENVI will open. This overrides any file lookup in the task runner. -- Value Type: STRING
input_raster_raw_output False False See ENVIRASTER input type Provide True to output an ENVI Binary instead of a tif. -- Value Type: STRING
color_table_name False N/A string Specify a string with the name of an IDL color table. The default value is Rainbow. Issue the following command to find valid strings: LOADCT, get_name=color_table_names. -- Value Type: STRING
data_maximum False N/A string Specify the maximum value used to calculate data ranges with NUMBER_OF_RANGES. If this is not set, then the largest value in the INPUT_RASTER band is used. -- Value Type: DOUBLE
reverse_color_table False N/A string Set this property to reverse the color table. Use this property in conjunction with COLOR_TABLE_NAME property. The options are true or false. -- Value Type: BOOLEAN
class_colors False N/A string Specify a (3,n) byte array with the RGB colors for the given ranges, where n is the number of classes. Use this property in conjunction with CLASS_RANGES. -- Value Type: BYTEARRAY
class_ranges False N/A string Specify a (2,n) array of color slice ranges, where n is the number of classes. In each array element, specify the minimum and maximum data value for the class. -- Value Type: DOUBLEARRAY
range_size False N/A string Specify the width of each data range to create. The NUMBER_OF_RANGES is used in conjunction with RANGE_SIZE. Any data above DATA_MINIMUM+NUMBER_OF_RANGES*RANGE_SIZE will not be classified. -- Value Type: DOUBLE
data_minimum False N/A string Specify the minimum value used to calculate data ranges with NUMBER_OF_RANGES or RANGE_SIZE. If this is not set, then the smallest value in the INPUT_RASTER band is used. -- Value Type: DOUBLE
number_of_ranges False N/A string Specify the number of data ranges to create. If RANGE_SIZE is specified, then the ranges are each that width, starting at DATA_MINIMUM and ending at DATA_MINIMUM+NUMBER_OF_RANGES*RANGE_SIZE. If RANGE_SIZE is not specified, then the ranges are equal width between DATA_MINIMUM and DATA_MAXIMUM. -- Value Type: UINT
class_names False N/A string Specify an array with the names for the given ranges. -- Value Type: STRINGARRAY
output_raster_uri_filename False N/A string Specify a string with the fully-qualified path and filename for OUTPUT_RASTER. -- Value Type: STRING

Outputs

The following table lists all ENVI_ColorSliceClassification outputs.
Mandatory (optional) settings are listed as Required = True (Required = False).

Name Required Default Valid Values Description
task_meta_data False N/A directory GBDX Option. Output location for task meta data such as execution log and output JSON
output_raster_uri True N/A directory Output for OUTPUT_RASTER. -- Value Type: ENVIURI

Output structure

The output_raster_uri file will be written to the specified S3 Customer Account Location.

Background

For additional background information on this task please refer to the Harris Geospatial ENVI documentation and
ENVI® Color Slice Classification.

Contact

If you have any questions or issues with this task, please contact gbdx-support@digitalglobe.com.