Select to view content in your preferred language

raster calculator issues!

1574
7
03-21-2012 08:32 PM
StephanieHooper
Emerging Contributor
--------------------------------------------------------------------------------

0


  Raster Calculator issues
I have tried every suggestion I've come across to use Raster Calculator to fill my 'NoData' holes in mosaic-ed Raster DEM.

I'm using ArcMap 10 and the equation I've been told to use is:

Filled_DEM = Con(isnull(["mosaic"]),FocalMean(["mosaic"], rectangle,4,4),["mosaic"])

ive tried changing around the capitalization, spacing, and even read somewhere that in ArcMap 10 focal stats. no longer works so I used :

Filled_DEM = Con(IsNull(["mosaic"]),FocalStatistics(["mosaic"], NbrRectangle(3,3),"MEAN"),["mosaic"])

and STILL nothing. can someone please help me - I've sat for hours trying to figure this out and I feel as though I've run out of options!!! Thanks!!!

Stephanie
0 Kudos
7 Replies
JeffreySwain
Esri Regular Contributor
Be advised that at 10, with the Python interface, there are different tools to replace the older ones.  I recommend trying to break it down in pieces with the specific geoprocessing tool in ArcToolbox and then copy it to the Python Window to see the syntax.  Once you have the pieces in place, then assembling them in Raster Calculator will be not problem. 

Con(IsNull('mosaic'), FocalStatistics('mosaic', NbrRectangle(4,4, CELL), 'MEAN', 'DATA'),"mosaic")

Also in the Raster Calculator syntax, I do not think you need the "Filled_DEM = " part.
0 Kudos
TarunJaiswal
Esri Contributor
--------------------------------------------------------------------------------

0


  Raster Calculator issues
I have tried every suggestion I've come across to use Raster Calculator to fill my 'NoData' holes in mosaic-ed Raster DEM.

I'm using ArcMap 10 and the equation I've been told to use is:

Filled_DEM = Con(isnull(["mosaic"]),FocalMean(["mosaic"], rectangle,4,4),["mosaic"])

ive tried changing around the capitalization, spacing, and even read somewhere that in ArcMap 10 focal stats. no longer works so I used :

Filled_DEM = Con(IsNull(["mosaic"]),FocalStatistics(["mosaic"], NbrRectangle(3,3),"MEAN"),["mosaic"])

and STILL nothing. can someone please help me - I've sat for hours trying to figure this out and I feel as though I've run out of options!!! Thanks!!!

Stephanie



Hello and greetings!

Please take a look at the following Knowledge Base - Remove and replace no data values within a raster using statistical information from the surroundin...

Hope this helps.

Thank you.
0 Kudos
ChrisBrannin
Regular Contributor
Everytime I run this, I get error 000539!?
0 Kudos
MelitaKennedy
Esri Notable Contributor
The help for the error says that it includes the issue that Python has encountered. What's the exact text you're getting with the error?
0 Kudos
ChrisBrannin
Regular Contributor
The help for the error says that it includes the issue that Python has encountered. What's the exact text you're getting with the error?


Thank you for responding to this. when I enter:
Con(IsNull('dem0'), FocalStatistics('dem0', NbrRectangle(9,9,"CELL"), 'MEAN'), "dem0")


I usually see error number 1: exceptions.TypeError: cannot concatenate 'str' and 'int' objects.

But I just ran it again and have this: Error running expression: rcexec()

Thank you for any insight on this.
0 Kudos
JeffreySwain
Esri Regular Contributor
In the Results window, what is the exact syntax that is being run?  Can you post that?  Also is 'dem0' in the map document?  It seems to be that it cannot resolve the naming of the raster.  Also can you run the script in segments?  Will the IsNull work on it's own?  Focal Stats?
0 Kudos
ChrisBrannin
Regular Contributor
In the Results window, what is the exact syntax that is being run?  Can you post that?  Also is 'dem0' in the map document?  It seems to be that it cannot resolve the naming of the raster.  Also can you run the script in segments?  Will the IsNull work on it's own?  Focal Stats?


'dem0' is in the map document. I have tried with multiple different raster images as well. I tried to run the tool in segments and get the same error 000539. I even tried run the tool as a stand alone python script but get the tool is not licensed error. I posted the syntax I used above? What am I missing?
0 Kudos