Jump to content

Round down raster values


Maya007

Recommended Posts

Hello all,

How can i round the raster pixel values with 5 decimals to just 2 decimals in ArcGIS. I tried the round down and it converted the raster into an integer file which is not what i want. I want to make a value like 1.00469 to 1.00 or a value like 0.93589 to 0.94 etc.

Thanks,

Maya

 

 

Link to comment
Share on other sites

Quote

Multiply your float raster by 100, add 0.5, run Int, and divide by 100 to round to the nearest hundredth.

For example, if your floating point value was 1.629 and you want to round to two decimal places, multiply by 100, and add 0.5, which leaves you with 163.4. Run Int, which truncates the value, leaving 163. Divide by 100, leaving 1.63, the desired value.

Quote

@phloem's answer only works in cases where your raster has positive values only. For a raster myrast with both negative and positive values, try the following:

Float(Int("myrast"*100 + (("myrast" > 0)*2 - 1)*0.5))/100.0

How to round up/down an pixel value of a raster to a pixel value with 2 decimal places?

related - Round Raster to next higher or lower int

Edited by rahmansunbeam
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist