Use the Classification to Vector tool to export selected classes to a vector shapefile.

You can also write a script to perform this step using the ClassificationToShapefile task.

Follow these steps:

  1. From the Toolbox, select Classification > Post Classification > Classification to Vector. The Data Selection dialog appears.
  2. Select an input classification image and perform optional spatial subsetting and masking, then click OK. The Convert Classification to Vector dialog appears.
  3. The Export Classes section contains a list of individual class names that were imported. Optionally choose one of the following from the Output Method drop-down list:
    • Single Vector Layer (default): Create one shapefile that contains all classes.
    • One Vector Layer per Class: Create multiple shapefiles, one per class.
  4. Specify the path and filename for the output shapefile in the Output Vector field. If you selected the One Vector Layer Per Class option in the previous step, ENVI will create multiple shapefiles and will automatically append the class names to the root filename.
  5. To reuse these task settings in future ENVI sessions, save them to a file. Click the down arrow and select Save Parameter Values, then specify the location and filename to save to. Note that some parameter types, such as rasters, vectors, and ROIs, will not be saved with the file. To apply the saved task settings, click the down arrow and select Restore Parameter Values, then select the file where you previously stored your settings.

  6. To run the process in the background, click the down arrow and select Run Task in the Background. If an ENVI Server has been set up on the network, the Run Task on remote ENVI Server name is also available. The ENVI Server Job Console will show the progress of the job and will provide a link to display the result when processing is complete. See ENVI Servers for more information.

  7. Click OK.

If you created one shapefile that contains all classes, that shapefile is added to the Data Manager and Layer Manager, and it appears in the Image window. Double-click the shapefile in the Layer Manager to display the Vector Properties dialog, then assign unique colors and line properties to the individual classes as needed. The following image shows an example of this step for a single shapefile with four classes:

If you right-click on the shapefile in the Layer Manager and select View Attributes, the Attribute Viewer lists individual polygon records for the different classes, organized by the CLASS_ID and CLASS_NAME attributes; for example:

If you created multiple shapefiles (one per class), the results are not added to the Data Manager or Layer Manager. You must open them manually in ENVI. Double-click each shapefile in the Layer Manager to display the Vector Properties dialog, then assign unique colors and line properties to the individual classes.

See Also


Classification to Pixel ROI, Classification to Polygon ROI, Convert ROIs to Shapefiles