Select to view content in your preferred language

Problem creating contours from DEM. They appear like they are from Minecraft.

2001
7
02-15-2022 06:03 PM
Labels (1)
JustinJohnston
Frequent Contributor

Hi Everyone,

I am having trouble with creating contours from a DEM. They are coming in all square if you zoom in on them, like they are from Minecraft or something.  I tried using focal statistics to smooth the raster, but has no effect on the square contours that result.  The DEM is from https://gisdata.pgplanning.org/opendata/downloadzip.asp?FileName=/data/FGDB/DEM2018.zip

Any ideas on how to smooth these?

Square ContoursSquare Contours

 

0 Kudos
7 Replies
DanPatterson
MVP Esteemed Contributor

what options did you use?

Contour—ArcGIS Pro | Documentation

and see Contour function—ArcGIS Pro | Documentation

for a more detailed discussion on factors that will affect the smoothness of the lines themselves. 

(ps, zoomed in at that level you are seeing the partial outlines of the cells that form the contour which is totally expected)


... sort of retired...
0 Kudos
SteveLynch
Esri Regular Contributor

Your input is integer.

 

You could add a bit of "noise" to your DEM. For example, use CreateRandomRaster

using your DEM's extent and cell size to create a raster of random values between 0 and 1. Add this noise to your DEM and Contour it.

0 Kudos
Robert_LeClair
Esri Notable Contributor

Using the Contour Raster Function on the DEM download listed in your original message, I have smooth contour "lines" that do not have that stairstep effect.  See below:
ContourRasterFunction.JPGContourRasterFunction2.JPG

0 Kudos
JustinJohnston
Frequent Contributor

I used the 3D Analyst Contour function, which may have worked differently than the Contour Raster Function.  Do the contours end up as lines with specific elevations?  I have never used that one.  

Cheers,

Justin

0 Kudos
DanPatterson
MVP Esteemed Contributor

From Raster functions—ArcGIS Pro | Documentation

You don't save the result to disk It is for display.  The contour function in my original link was to explain the things that will affect your blockiness


... sort of retired...
0 Kudos
Robert_LeClair
Esri Notable Contributor

Because the "output" per se of a raster function is still the original DEM just drawn differently, there is no way to create labels for the contour lines as they're raster cells still.  You can set the Z-base contour like 0 and then set the contour interval every 20' with every 5th contour being bold.  In this case, the "output" of the raster function is for display purposes only. I'm converting the DEM from an integer to a floating point raster and plan to run the Contour GP tool (Spatial Analyst) and see if that helps smooth the stairstep effect.  More to come!

0 Kudos
Robert_LeClair
Esri Notable Contributor

Okay - here's what will work.  Run the Focal Statistics GP tool with a rectangular neighborhood.  For the width and length, I used 7.  You can play with the values as you see fit.

Using the output of the Focal Statistics tool, I used it as the input for the Contour (Spatial Analyst) GP tool and voila!  Smooth contours!  See below.

FocalStats.JPG

0 Kudos