Summary
When elevation values across water body surfaces are not uniform in an elevation raster, contour lines generated from the elevation raster can run across the water body surfaces.
Contour lines that do not run across water body surfaces can be created in ArcGIS Pro by modifying the pixel values of the water bodies on the elevation surface to a uniform base value. For example, this can be useful for studying the contours of a mountain range without lines on the surfaces of lakes, which are flat.
This article provides the workflow to modify an elevation surface to avoid generating contours running across water body surfaces. The image below shows an elevation raster of a mountain range with contour lines on the surface of lakes.
Procedure
- Open the ArcGIS Pro project and add vector data representing water body features. In this example, polygons representing the lakes in the elevation raster are added to the map.
- Create a new field in the water body features polygon layer with a value of zero.
Note:
A value of zero refers to the base level of measuring elevation, also known as sea level.
- Right-click the polygon layer in the Contents pane, and select Attribute Table.
- In the attribute table, click Add Field and specify a name for Field Name. In this example, the field name is ‘Surface’.
- Click Save on the top ribbon.
- In the attribute table, right-click the newly created field, and click Calculate Field to open the Calculate Field window.
- Type ‘0’ in the expression box and click OK.
The image below shows a value of zero assigned to the new field for all water body features.
- Use the Polygon to Raster tool to convert the water body features polygon layer to a raster layer.
- On the ribbon, click Analysis > Tools.
- In the Geoprocessing pane, search for and select Polygon to Raster (Conversion Tools).
- Select the polygon layer for Input Features.
- Select the new field from Step 2 for Value field.
- Specify the location and name for Output Raster Dataset.
- Select the elevation raster for Cellsize to assign the same pixel size, and click Run.
The image below shows the raster layer of the water body features on the map.
- Use the Mosaic To New Raster tool to combine the water body raster and the elevation raster layers into a new raster.
- In the Geoprocessing pane, search for and select Mosaic To New Raster (Data Management Tools).
- For Input Rasters, select the elevation raster layer first and the water body raster second.
- Specify a location for Output Location.
- Specify a name for Raster Dataset Name with Extension.
- Optionally, select a bit depth for Pixel Type.
- Specify a band number for Number of Bands.
Note:
Right-click the elevation layer in the Contents pane, and click Properties > Source > Band Metadata to view the number of bands in the layer.
- Ensure Mosaic Operator is set to Last for the output cell value of the overlapping areas to be the value from the last raster dataset mosaicked into the location. In this example, the last raster is the water body raster.
- Click Run.
The image below shows the combined raster added to the map.
- Use the Contour tool to create contour lines for the combined raster from Step 4.
The image below shows a comparison of the contour lines before and after modifying the elevation surface.
Note:
The contour lines around water body surfaces can be manually deleted. Optionally, increase the value of contour intervals in the Contour tool to decrease the number of contour lines around water body surfaces.