# Raster elevation calculation

2587
13
05-27-2018 10:17 AM
New Contributor II

Hello,

I have forgotten how to express in the Raster Calculator, that I want elevations " 35m through 100m" from a raster.

Any help is appreciated, also if there is an example reference guide somewhere, please feel free to share.

Thanks

Phil

1 Solution

Accepted Solutions
MVP Esteemed Contributor

Did you 'type' the expression? Always select the grid from the list of layers and variables, then select the operands and numbers like on a calculator.  In that way, the expression will be correct.

Try

Con((bells >= 3150) & ( bells < 3400), 1, 0)

no typing... except for the grid name... and try a *.tif in a folder rather than a geodatabase (ie c:\GISwork\...\rast6.tif

13 Replies
MVP Esteemed Contributor

("Elev" > 35) and ("Elev" < 100)

or whatever... you grid AND you must reuse the grid's name for both conditions, you can't do "Elev" > 35 and < 100

New Contributor II

Thanks!

MVP Esteemed Contributor

Philipp, no problem... but if it works, mark the question answered so others will know a solution was found

New Contributor II

I wish I could say it worked, but it did not. I tried a few other options like using "&" etc., but did not find a combination that worked. I also tried the instructions in the link you provided. Thanks again. (p.s. the other two rasters are just simple queries made from "bells" < 3000 and "bells" > 3500.  "bells" is a DEM just to clarify.

MVP Esteemed Contributor

Did you 'type' the expression? Always select the grid from the list of layers and variables, then select the operands and numbers like on a calculator.  In that way, the expression will be correct.

Try

Con((bells >= 3150) & ( bells < 3400), 1, 0)

no typing... except for the grid name... and try a *.tif in a folder rather than a geodatabase (ie c:\GISwork\...\rast6.tif

New Contributor II

I did not type the expression (except for the word "and" and the commas)

New Contributor II

That worked! The formula looks like the following:

Con(("bells" >= 3150) & ( "bells" < 3400), 1, 0)

Very happy, thanks!

New Contributor II

I have not attempted this yet, but I will now need to multiply this .tif with a slope, aspect and one other raster. Do you foresee any problem multiplying a raster and a .tif? Thanks again!

MVP Esteemed Contributor

A *.tif is just a form of raster.

What you have to worry about is making sure that the extent, cell size and snap raster are set BEFORE you begin any raster work.

This is done in the Environments tab of any tool in the spatial analyst tools.

It is easy to get results.... it takes work to get proper results