Hi, I am trying to generate a raster with the raster calculat and getting error 000539

3787
9
04-21-2016 06:29 AM
asafshnel
New Contributor

Hi everyone, my name is Asaf and I am doing a GIS course, I have been trying to generate some rasters using the raster calculator but I get this error message: "error 000539: error running expression: rcexec () < type 'exceptions runtime error' > error 000732: input raster: Dataset C:/ Users......"

first, I used the raster layer "nav_dem_10m"(its an elevation raster) from the gdb file we downloaded from the course as the input to create a slope and aspect rasters using the spatial analyst tool> surface>slope/aspect.

second, I used the new slope raster to generate a raster with slopes grater than 20 degrees, using the raster calculator.

that went fine. But when I try to make a new raster showing only the westerly aspect, by using the raster calculator, I get the above error.

Here is what I type in the calculator: ("Aspect_nav_d1" > 225) & ("Aspect_nav_d1" < 315).

I get this error for other rasters I try to create with the raster calculator, for example if I try to make a raster showing only elevations around 150 meters using the mentioned above elevation raster "nav_dem_10m"

Here is the URL for this map document, it is publicly shared.

http://www.arcgis.com/home/item.html?id=0d1d560478a04bc8948a188c8c45c631

Thanks in advance, Asaf

0 Kudos
9 Replies
JayantaPoddar
MVP Esteemed Contributor

Try this expression

Con(("Aspect_nav_d1" > 225) & ("Aspect_nav_d1" < 315), "Aspect_nav_d1", 0)

Also keep the NoData Value as zero in the tool environment settings.



Think Location
asafshnel
New Contributor

Thanks for the reply,

I just opened the raster calculator and clicked on environments, were do I find the NoData Value?

0 Kudos
DanPatterson_Retired
MVP Emeritus

You can set environments in Geoprocessing menu options.

Better still use the Con tool Con—Help | ArcGIS for Desktop

and set your environments in the Environments button on the bottom right of the dialog.

The raster calculator is 'nice', but you should really get used to using the tools in arctoolbox, since you have definitive control over everything and you can move on to scripting by concatenating the workflows obtained from successful runs of the tool from the Results window.

0 Kudos
asafshnel
New Contributor

Hi Dan, I used the Conditional tool with this expression:" Con(("Aspect_nav_d1" > 225) & ("Aspect_nav_d1" < 315), "Aspect_nav_d1", 0) "

and also this expression:" ("Aspect_nav_d1" > 225) & ("Aspect_nav_d1" < 315) "

it generates a layer but the values are high / low instead of "0" and "1" values. and the layer is invisible.

I still couldn't find the "NoData Value as zero in the tool environment settings".

but at least I don't get the error message.

0 Kudos
asafshnel
New Contributor

I forgot to mention I used Aspect_nav_d1 for the input conditional raster, input true raster and input false raster.

0 Kudos
DanPatterson_Retired
MVP Emeritus

the second expression will return 1 and 0, the first expression will return "aspect_nav_d1" value if the condition is true... if the condition is false, it returns 0.  That is what con does... it does a conditional check, then returns what is the "true" block, otherwise, the "false block"

Con( do some check here, what to do if true, what to do if false)

0 Kudos
asafshnel
New Contributor

no matter what expression I use,I get an invisible layer and the values are:

high:  3.40282e+038

low:  -3.40282e+038

what about setting the NoData Value as zero in the tool environment settings. under which environment do I find it? I have looked around for it but cant find it.

0 Kudos
asafshnel
New Contributor

no matter what expression I use,I get an invisible layer and the values are:

high:  3.40282e+038

low:  -3.40282e+038

what about setting the NoData Value as zero in the tool environment settings. under which environment do I find it? I have looked around for it but cant find it.

0 Kudos
asafshnel
New Contributor

no matter what expression I use,I get an invisible layer and the values are:

high:  3.40282e+038

low:  -3.40282e+038

what about setting the NoData Value as zero in the tool environment settings. under which environment do I find it? I have looked around for it but cant find it.

0 Kudos