# Rounding and converting raster values

1458
16
07-27-2021 07:15 AM
by
New Contributor III

Hello,

I'm using ArcGIS Pro 2.8.1. I have a raster layer whose values I would like to round and then convert into a corresponding value. For example, if the current value is 9.788, I would round that to 10 and convert that to 144. Is there a way to do this?

Tags (3)
16 Replies
MVP Esteemed Contributor

This is what I calculated. Please correct me if I am wrong.

 Result of Con Function(Raster Value) Con Function -1 Calculation of No. of Days Julian Day 1 0 16 x 0 0 2 1 16 x 1 16 3 2 16 x 2 32 4 3 16 x 3 48 5 4 16 x 4 64 6 5 16 x 5 80 7 6 16 x 6 96 8 7 16 x 7 112 9 8 16 x 8 128 10 9 16 x 9 144 11 10 16 x 10 160 12 11 16 x 11 176 13 12 16 x 12 192 14 13 16 x 13 208 15 14 16 x 14 224 16 15 16 x 15 240 17 16 16 x 16 256 18 17 16 x 17 272 19 18 16 x 18 288 20 19 16 x 19 304 21 20 16 x 20 320 22 21 16 x 21 336 23 22 16 x 22 352

Think Location
by
New Contributor III

This makes sense! However, in my case, the Julian day begins at 1, not 0. Here's a chart of the conversion; would this mean the subtraction is not necessary?

MVP Esteemed Contributor

Just add 1 at the end of the expression (outside all brackets). Updated my last expression.

Think Location
by
New Contributor III

To clarify, do you mean like this?

``16*((Con(("RASTER" - (RoundDown("RASTER"))== 0.5),RoundUp("RASTER"),RoundUp("RASTER" - 0.5)))-1)+1``

MVP Esteemed Contributor

Yes.

Think Location
by
New Contributor III

Okay, thank you so much!! I really appreciate your help.

MVP Regular Contributor

``Int("RASTER" + 0.5)``