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?
Solved! Go to Solution.
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 |
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?
Just add 1 at the end of the expression (outside all brackets). Updated my last expression.
To clarify, do you mean like this?
16*((Con(("RASTER" - (RoundDown("RASTER"))== 0.5),RoundUp("RASTER"),RoundUp("RASTER" - 0.5)))-1)+1
Yes.
Okay, thank you so much!! I really appreciate your help.
If your values are all positive, just add 0.5 before truncating.
Int("RASTER" + 0.5)
You can then reclassify the rounded values to whatever you want.