This task exports one or more classes to a single shapefile. The vectors include separate records for each polygon.
Example
e = ENVI()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
ClassTask = ENVITask('ISODATAClassification')
ClassTask.INPUT_RASTER = Raster
ClassTask.Execute
SmoothTask = ENVITask('ClassificationSmoothing')
SmoothTask.INPUT_RASTER = ClassTask.OUTPUT_RASTER
SmoothTask.Execute
AggregationTask = ENVITask('ClassificationAggregation')
AggregationTask.INPUT_RASTER = SmoothTask.OUTPUT_RASTER
AggregationTask.Execute
ClassToVectorTask = ENVITask('ClassificationToShapefile')
ClassToVectorTask.INPUT_RASTER = AggregationTask.OUTPUT_RASTER
ClassToVectorTask.Execute
DataColl = e.Data
DataColl.Add, AggregationTask.OUTPUT_RASTER
DataColl.Add, ClassToVectorTask.OUTPUT_VECTOR
View = e.GetView()
Layer1 = View.CreateLayer(AggregationTask.OUTPUT_RASTER)
Layer2 = View.CreateLayer(ClassToVectorTask.OUTPUT_VECTOR)
Syntax
Result = ENVITask('ClassificationToShapefile')
Input properties (Set, Get): APPLY_SYMBOLOGY, EXPORT_CLASSES, INPUT_RASTER, OUTPUT_METHOD, 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:
APPLY_SYMBOLOGY (optional)
Set this property if you want to generate a vector style sheet that will automatically set the colors of the output polygons to match the class colors of the input raster.
EXPORT_CLASSES (optional)
Specify a string array with class names to export to the shapefile.
INPUT_RASTER (required)
Specify a classification raster from which to generate a shapefile.
OUTPUT_METHOD (optional)
Specify a string indicating whether the output is a single vector layer with all classes, or one vector layer per class. The choices are:
- Single Vector Layer (default): If you specify this option, provide a single filename for OUTPUT_VECTOR.
- One Vector Layer per Class: If you specify this option, the output filenames will be <output filename>_<class name>.shp, one for each class.
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 |
ENVI 5.5. 2 |
Deprecated EXPORT_AREA and EXPORT_CLASS_CLRS properties. Added APPLY_SYMBOLOGY and OUTPUT_METHOD properties.
|
API Version
4.3
See Also
ENVITask, VectorRecordsToROI Task, ClassificationToPixelROI Task, ClassificationToPolygonROI Task