Generate Full-Resolution Contour Lines

Use the Generate Contour Lines tool to create a shapefile of contour lines from a full-resolution input raster.

You can write a script to generate full-resolution contour lines using the GenerateContourLines task.

Follow these steps:

  1. From the ENVI Toolbox, select Terrain > Generate Contour Lines. The Generate Contour Lines dialog appears.
  2. Select an Input Raster such as a digital elevation model (DEM) or any dataset where you want to categorize the data with contour lines.
  3. In the Levels field, enter an array of values from which to create contour lines. For example, an array of [5, 10, 15, 20] in a georeferenced DEM will create contour lines every 5, 10, 15, and 20 units.
  4. Instead of manually entering the values, you can click the Define Values button . The Generate Index Array dialog appears. Specify any combination of the following values to automatically create an array for Levels:

    Click OK in the Generate Index Array dialog.

    See Examples of Contour Levels below.

    To save the Levels array to a JSON-format file on disk, click the Save Values button and select a filename and location for the output file (.json).

    To restore an array of values from disk, click the Open Values button and select a .json file.

  5. In the Minimum Length field, specify the minimum contour length to be considered. Lines shorter than this value will be discarded. This property is not set by default, which means that all contours will be included in the output. The units depend on the coordinate system of the input raster.
  6. In the Output Vector field, specify a path and filename for the output shapefile of contour lines.
  7. Enable the Preview check box to see a preview of the settings before you click OK to process the data. The preview is calculated only on the area in the view and uses the resolution level at which you are viewing the image. See Preview for details on the results. To preview a different area in your image, pan and zoom to the area of interest and re-enable the Preview option.
  8. Enable the Display result check box to display the output in the view when processing is complete. Otherwise, if the check box is disabled, the result can be loaded from the Data Manager.
  9. 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.

  10. 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.

  11. Click OK.

Examples of Contour Levels

Example 1:

Example 2:

Example 3:

Example 4:

See Also

Overlay Contour Lines