>  Docs Center  >  Using ENVI  >  Generate Full-Resolution Contour Lines


Generate Full-Resolution Contour Lines

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 ENVIGenerateContourLinesTask routine.

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:

    • Number of Elements: Optional. Indicate the number of elements in the resulting array.
    • Minimum Value: Optional. Indicate the minimum value of the array.
    • Maximum Value: Optional. Indicate the maximum value of the array.
    • Increment: Optional. Indicate the desired increment between consecutive values.
    • Set the Reverse radio button to Yes to reverse the order of the output elements. The default selection is No.

    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 Image window and uses the resolution level at which you are viewing the image. See Preview for details on the results.
  8. Enable the Display result check box to display the QUAC-corrected raster in the Image window when processing is complete. Otherwise, if the check box is disabled, the pan sharpened raster can be loaded from the Data Manager.
  9. Click OK. ENVI adds the resulting output to the Data Manager and, if the Display Result check box was enabled, adds the layer to the Layer Manager and displays the output in the Image window.

Examples of Contour Levels

Example 1:

  • Number of Elements: Not set
  • Minimum Value: 10
  • Maximum Value: 20
  • Increment: 3
  • Reverse: No
  • Resulting array: [10, 13, 16, 19]

Example 2:

  • Number of Elements: 4
  • Minimum Value: Not set
  • Maximum Value: 150
  • Increment: 10
  • Reverse: No
  • Resulting array: [120, 130, 140, 150]

Example 3:

  • Number of Elements: 25
  • Minimum Value: 20
  • Maximum Value: Not set
  • Increment: 5
  • Reverse: No
  • Resulting array: [20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140]

Example 4:

  • Number of Elements: 12
  • Minimum Value: Not set
  • Maximum Value: 0
  • Increment: -0.25
  • Reverse: No
  • Resulting array: [0,-0.25,-0.5,-0.75,-1,-1.25,-1.5,-1.75,-2,-2.25,-2.5,-2.75]
  • Setting the Increment to a positive value and setting the Reverse option to Yes will produce the same result.

See Also

Overlay Contour Lines

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