Select to view content in your preferred language

"Square" function in Raster Calculator of ArcGIS Pro

3584
7
10-30-2019 09:16 AM
FabioGrita
Emerging Contributor

"Square" function in Raster Calculator of ArcGIS Pro doesn't work if used with a constant value. I used the expression:

SquareRoot(Square(("CostDist_fromGRUMP_bl_degrees" * 0)   0.004167))

instead of

SquareRoot(Square((0.004167))

to by-pass the problem. Has anybody else had the same issue?

Tags (2)
0 Kudos
7 Replies
DanPatterson_Retired
MVP Emeritus
0 Kudos
FabioGrita
Emerging Contributor

It works in ArcGIS Desktop, because I used this function in the past (I

don't use ArcGIS desktop anymore). The prob is with ArcGIS pro.

0 Kudos
DanPatterson_Retired
MVP Emeritus

yes, the raster calculator isn't the same in pro.

A work around, which is quite ugly is to use the raster calculator with an expression

CreateConstantRaster(0.1, "FLOAT")

BUT, you have to switch over to the Environments tab and set the extent and cell size to match of an existing raster before hitting Run.

For example, taking a raster "x", multiplying it by the square of 0.1, then taking the square root

SquareRoot("x" * Square(CreateConstantRaster(0.1, "FLOAT")))

I suspect that you will start using "raster functions" or other approaches since the raster calculator has a slightly different purpose than it did.

0 Kudos
FabioGrita
Emerging Contributor

Interesting. Thanks Dan. Actually, I thought of generating a constant-value

raster, but then I opted for the even uglier solution I mentioned. And of

course it worked, but I wanted to report the prob to the ESRI guys..

0 Kudos
DanPatterson_Retired
MVP Emeritus

I will put the question up on Beta 2.5 to see if anyone has any comments

0 Kudos
FabioGrita
Emerging Contributor

Great, thanks

0 Kudos
ElizabethGraham
Esri Contributor

Hi Fabio,

Please update your expression to only have 2 open parentheses and let me know if you were then able to execute your expression successfully within the Raster Calculator.  

SquareRoot(Square(0.004167))

Also, please make sure you have both your extent and cellsize set.

Thanks,

Liz