Skip to main content
Question

Raster cell replacer

  • May 22, 2017
  • 8 replies
  • 97 views

Forum|alt.badge.img

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

david_r
Celebrity
  • May 23, 2017

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


Forum|alt.badge.img
  • May 23, 2017

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".


Forum|alt.badge.img
  • Author
  • May 23, 2017

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

lau
Forum|alt.badge.img+3
  • May 23, 2017

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


Forum|alt.badge.img
  • Author
  • May 23, 2017

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.


lau
Forum|alt.badge.img+3
  • May 23, 2017

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

david_r
Celebrity
  • May 25, 2017

 

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

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • May 26, 2017

RasterInterpretationCoercer can be used to cast the values.

Convert float to integer can be set to ceiling.