Skip to main content

Hi,

I hope someone can assist me. I need to round up all the cell values for a ascii grid file. This can be done in the spatial analyst esri tool reclassify.

ie. cellvalue = 10.00001 to 10.99999 round up to 11.

Is this easily possible for all values to round up ie 1,2,3 etc.

Thanks

Have a look at the RasterCellValueRounder. If you need integer values, leave the number of decimals at zero.


Maybe it works with the transformer "RasterInterpretationCoercer", the values are rounded because you've only 256 values. For my work I've selected the option "UInt8".


Have a look at the RasterCellValueRounder. If you need integer values, leave the number of decimals at zero.

 

Hi David,

 

 

Would it be possible to round up a whole number ie 10.00000 to 10.99999 = 11? using the RasterCellValueRounder?

 

 

thanks

Hi,

Have you tried the RasterCellValueReplacer?

Another solution is to define ranges in the RasterExpressionEvaluator.

--> https://knowledge.safe.com/articles/1226/using-conditions-with-the-rasterexpressionevaluato.html


Hi,

I tried the RasterCellValueReplacer however due to the change to full numbers ie 10.0000 0 to 10.99999 = 11 when the next RasterCellValueReplacer runs ie 11.0000 0 to 11.99999 to 12 it obviously replaces the 11 is previously created with 12. Esri's reclassify does not have this issue as i cannot find a way to do the entire file withour pushing it through multiple replace transformer.

 

The ExpressionEvaluator could work but im not sure how i capture these full numbers.


Hi,

I tried the RasterCellValueReplacer however due to the change to full numbers ie 10.0000 0 to 10.99999 = 11 when the next RasterCellValueReplacer runs ie 11.0000 0 to 11.99999 to 12 it obviously replaces the 11 is previously created with 12. Esri's reclassify does not have this issue as i cannot find a way to do the entire file withour pushing it through multiple replace transformer.

 

The ExpressionEvaluator could work but im not sure how i capture these full numbers.

If you use multiple RasterCellValueReplacer and starts to define the highest ranges, you would not encounter this kind of issue

 

Hi David,

 

 

Would it be possible to round up a whole number ie 10.00000 to 10.99999 = 11? using the RasterCellValueRounder?

 

 

thanks
If you set the rounding direction to "up" you will get

 

11.0 -> 11

 

11.1 -> 12

 

11.9 -> 12

 

12.0 -> 12

 

12.1 -> 13

 

etc

 


RasterInterpretationCoercer can be used to cast the values.

Convert float to integer can be set to ceiling.


Reply