Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  ENVI API  >  Processing  >  ENVIClassificationToShapefileTask

ENVIClassificationToShapefileTask

ENVIClassificationToShapefileTask

This task exports one or more classes to a single shapefile. The vectors include separate records for each polygon.

Example


; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Process a spatial subset
Subset = ENVISubsetRaster(Raster, $
  Sub_Rect=[600,200,799,399])
 
; Create a classification ENVIRaster
ClassTask = ENVITask('ISODATAClassification')
ClassTask.INPUT_RASTER = Subset
ClassTask.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
ClassTask.Execute
 
; Run the smoothing task
SmoothTask = ENVITask('ClassificationSmoothing')
SmoothTask.INPUT_RASTER = ClassTask.OUTPUT_RASTER
SmoothTask.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
SmoothTask.Execute
 
; Run the aggregation task
AggregationTask = ENVITask('ClassificationAggregation')
AggregationTask.INPUT_RASTER = SmoothTask.OUTPUT_RASTER
AggregationTask.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
AggregationTask.Execute
 
; Convert the classes to shapefiles
ClassToVectorTask = ENVITask('ClassificationToShapefile')
ClassToVectorTask.INPUT_RASTER = AggregationTask.OUTPUT_RASTER
ClassToVectorTask.OUTPUT_VECTOR_URI = e.GetTemporaryFilename('shp')
ClassToVectorTask.Execute
 
; Get the collection of data objects currently available in the Data Manager
DataColl = e.Data
 
; Add the output to the Data Manager
DataColl.Add, AggregationTask.OUTPUT_RASTER
DataColl.Add, ClassToVectorTask.OUTPUT_VECTOR
 
; Display the result
View1 = e.GetView()
Layer1 = View1.CreateLayer(AggregationTask.OUTPUT_RASTER)
Layer2 = View1.CreateLayer(ClassToVectorTask.OUTPUT_VECTOR)

Syntax


Result = ENVITask('ClassificationToShapefile')

Input properties (Set, Get): EXPORT_AREA, EXPORT_CLASSES, EXPORT_CLASS_CLRS, INPUT_RASTER, OUTPUT_VECTOR_URI

Output properties (Get only): OUTPUT_VECTOR

Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

Methods


This task inherits the following methods from ENVITask:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

EXPORT_AREA (optional)

Set this property to export AREA as a shapefile attribute for each polygon. The options are true (default) or false. The default value is 1.

EXPORT_CLASSES (optional)

Specify a string array with class names to export to the shapefile.

EXPORT_CLASS_CLRS (optional)

Set this property to export CLASS_CLRS (class colors) as a shapefile attribute for each polygon. The options are true (default) or false. The default value is 1.

INPUT_RASTER (required)

Specify a classification raster from which to generate a shapefile.

OUTPUT_VECTOR

This is a reference to the output vector.

OUTPUT_VECTOR_URI (optional)

Specify a string with the fully-qualified path and filename for OUTPUT_VECTOR.

Version History


ENVI 5.2

Introduced

API Version


3.2

See Also


ENVITask, ENVITask::Parameter, ENVIVectorRecordsToROITask



© 2018 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us