Select to view content in your preferred language

Fill in NoData values

8661
8
01-23-2012 09:43 AM
BarryGuidry
Regular Contributor
I have created an ESRI grid from LIDAR data, after first processing grids in Surfer. But, based on the spacing I specified in Surfer, there are gaps (NoData) in the ESRI grid created from the "ground-surface" returns, due to the building locations (in the unclassified return). Can someone help me figure out how to fill in these gaps (of NoData), likely with the "nearest neighbors"?
8 Replies
TimothyHales
Esri Notable Contributor
Check out this forum thread: Raster Calculator: Fill in NoData. It discusses using the Raster Calculator to fill the gaps.


ArcGIS 9.3.1
con(isnull(Raster_DEM), focalmean(Raster_DEM, rectangle,4,4), Raster_DEM)


ArcGIS 10
Con(IsNull(Raster), FocalStatistics(Raster, NbrCircle(10, "CELL"), "MEAN"), Raster)
JohannaPrüssmann
Occasional Contributor

Hello,

I tried Timothy Hales' algorithm in ArcGIS 10.1 for fillind NoData holes in my DEM, but I get the following error message:

Executing: RasterCalculator Con(IsNull("Tecbaco_DEM.tif"), FocalStatistics(Raster, NbrCircle(10, "CELL"), "MEAN"), "Tecbaco_DEM.tif") "C:\Users\HOME\Copy\- WWF\- TECBACO\DEM v.2\Tecbaco_DEM_Fill.tif"

Start Time: Mon Feb 02 19:36:05 2015

Con(IsNull(Raster(r"Tecbaco_DEM.tif")), FocalStatistics(Raster, NbrCircle(10, "CELL"), "MEAN"), Raster(r"Tecbaco_DEM.tif"))

ERROR 000539: Error running expression: rcexec()

Traceback (most recent call last):

  File "<expression>", line 1, in <module>

  File "<string>", line 5, in rcexec

  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 4830, in FocalStatistics

    ignore_nodata)

  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, in swapper

    result = wrapper(*args, **kwargs)

  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 4824, in wrapper

    ignore_nodata)

  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 484, in <lambda>

    return lambda *args: val(*gp_fixargs(args, True))

RuntimeError: Object: Error in executing tool

Failed to execute (RasterCalculator).

Failed at Mon Feb 02 19:36:05 2015 (Elapsed Time: 0.00 seconds)

I used the following algorithm:

Con(IsNull("Tecbaco_DEM.tif"), FocalStatistics(Raster, NbrCircle(10, "CELL"), "MEAN"), "Tecbaco_DEM.tif")

Do you have any idea why this might be happening?

0 Kudos
XanderBakker
Esri Esteemed Contributor

You should replace "Raster" by your TIFF:

Con(IsNull("Tecbaco_DEM.tif"), FocalStatistics("Tecbaco_DEM.tif", NbrCircle(10, "CELL"), "MEAN"), "Tecbaco_DEM.tif")

JohannaPrüssmann
Occasional Contributor

Thanks for the quick response. I'm sorry, I did not notice the second "raster" instance. I will try once again and let you know how it goes.

0 Kudos
JohannaPrüssmann
Occasional Contributor

Yep, it worker wonderfully. Thanks for your help!

0 Kudos
XanderBakker
Esri Esteemed Contributor

You're welcome. Glad it worked!

0 Kudos
DanPatterson_Retired
MVP Emeritus

You will have better results if you convert to an Esri grid for both the inputs and the outputs in a folder with no spaces and a shorter file name.  In theory you should be able to use any raster, but I notice many of the issues revolve around 'image' rasters which may be multiband and may not play nicely with many of the SA functions

0 Kudos
JohannaPrüssmann
Occasional Contributor

Thanks for the advice. Will do.

0 Kudos