Summary
Generating contours from elevation rasters may result in contours running across water body surfaces, which does not happen in reality because a water body surface is flat. Elevation raster pixel values do not reflect the flat surface of a water body, as the pixel values in the elevation raster vary. Therefore, when generating contours from an elevation layer, the contours may run across water body surfaces.
This article provides the workflow to avoid generating contours that run across a water body surface by modifying the elevation raster pixel values to a uniform value.
Procedure
- Acquire vector data that represents water body features, or manually digitize water bodies with the assistance of high resolution imagery.
- Add a new field to the polygon layer of water bodies, and assign a value of 0 to the new field using the Field Calculator for all water body features.
- Run the Polygon to Raster tool to convert the water body polygon layer into raster layer.
- In the Catalog window, navigate to System Toolboxes > Conversion Tools > To Raster > Polygon to Raster.
- Select the polygon layer as Input Features.
- Select the new field from Step 2 as Value field.
- Specify a location and name for Output Raster Dataset.
- Select the elevation raster as Cellsize to assign the same pixel size.
- Click OK.
- Run the Mosaic to New Raster (Data Management) tool to mosaic the elevation raster and the water body raster generated from Step 3 to a new raster.
- Navigate to System Toolboxes > Data Management Tools > Raster > Raster Dataset > Mosaic To New Raster.
- Select the water body raster and elevation raster as Input Rasters.
Note:
Put the water body raster on top of the list and select FIRST for Mosaic Operator. The value 0 from the water body raster will overwrite the pixel value of the elevation raster in the output raster mosaic.
- Specify the Output Location for the output raster.
- Specify the Raster Dataset Name with Extension.
- Specify a value for the Number of Bands.
- Click OK.
- Run the Contour tool to generate contour for the raster generated from Step 4.
Note:
The Contour tool requires a 3D Analyst or Spatial Analyst license.
- Navigate to System Toolboxes > 3D Analyst > Raster Surface > Contour.
- Select a layer as the Input raster.
- Specify a location and name for the Output polyline features.
- Set a value for the Contour Interval.
- Click OK.