Suggestions for removing/smoothing roads in a DEM

4771
9
06-01-2016 05:14 PM
JeremyKiss1
New Contributor II

I'm looking for methods to remove/smooth roads and their associated ditches within a LiDAR DEM. I was trying ArcHydro's DEM reconditioning tool to lower the roads and raise the ditches using the road network shapefile but the outputs were not very satisfactory. I don't have the original LiDAR points but I was thinking of extracting the elevation data from each cell (1m2) to points, removing all points along the roads and ditches and then re-creating the DEM. The previous roads would be re-interpolated from the other points causing them to be smoothed out. Any suggestions would be greatly appreciated.

0 Kudos
9 Replies
DanPatterson_Retired
MVP Emeritus

I don't know what the roads and pixels look like in pixel world (width wise we will say 3), but if they could convert those to nodata,  then do a smoothing filter over the remaining raster using a wider filter window (say 5x5 or 7x7). And finally you could use the Con and IsNull statement to replace the nodata area with the filtered DEM leaving the remaining DEM values intact. 

roadless = raster with nodata areas replacing the roads and ditches

filtered  = Focal Statistics—Help | ArcGIS for Desktop  with a 7x7 mean or median, keeping no_data option to Data (ie no data is ignored)

It would be something like this with fiddly  " quotes etc around the grid names I suspect, but I can't test on an iPad

Con(IsNull( raster1), filtered, roadless)

JeremyKiss1
New Contributor II

Thanks for your response, I might be able to make this work. I am having trouble completing the last step, I'm getting errors when I try the Con & IsNull statement. But even without completing it, I can tell there would be sharp elevation jumps between the filtered DEM and the original. I would need another step to smooth those out, as this would be intended for hydrological modeling.

0 Kudos
DanPatterson_Retired
MVP Emeritus

you would have to show the syntax of the con, isnull in order to comment.

To make it useable, you will need to do the standard dem filling Fill—Help | ArcGIS for Desktop

and you might want to explore your dem with Sink—Help | ArcGIS for Desktop

if you are having issues with it

0 Kudos
JeremyKiss1
New Contributor II

Con(IsNull("setnull"),"focal90","DEMClp")

Where setnull is the DEM with the roads given no data, focal90 is the filtered DEM, and DEMClip is the original DEM.

The modeling we are doing isn't very traditional hydrological modeling. We are interested in the depressions and so for certain aspects we want to avoid filling. So in order to smooth this discontinuities, would anything happen if I resampled the DEM to the same resolution using the cubic resampling technique?

0 Kudos
DanPatterson_Retired
MVP Emeritus

typo or copy or error DEMClp vs DEMClip ... "i" and what is the error and are you using the Con tool or the raster calculator?

0 Kudos
JeremyKiss1
New Contributor II

Neither, habitual abbreviation haha. Using the raster calculator.

Error 000539: error running expression:rcexec()

RuntimeError: Error 010240 Could not save raster data to .... with output format FGDBR

0 Kudos
DanPatterson_Retired
MVP Emeritus

seen that before... too lazy to look, but try setting the output as an esri grid to a real folder with a short name without spaces and not beginning with a number... you can always move it into your gdb when it works.

0 Kudos
JeremyKiss1
New Contributor II

Got it to work, those layers had locks on them because I was viewing them in ArcScene. Still looking for a method to smooth the discontinuities at the edge of the filtered and original rasters.

0 Kudos
DanPatterson_Retired
MVP Emeritus

clip after, if you started with more than you need before

EDIT

I thought you meant the edge of the study area.  The only way I could think of is to add a small amount of random variation into the no data area, then add it to the filtered result

0 Kudos