[GRASS-user] rounding raster values

Adam Dershowitz adershowitz at exponent.com
Wed May 1 12:54:21 PDT 2013


You can convert, and convert back.  I think that this would work:

r.mapcalc "output = round(input * 1000)/1000.0"

-- Adam


From: Paulo van Breugel <p.vanbreugel at gmail.com<mailto:p.vanbreugel at gmail.com>>
Date: Wednesday, May 1, 2013 11:48 AM
To: GRASS users email list <grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>>
Subject: [GRASS-user] rounding raster values

Hi,

I have floating raster layers which values I want to round to x decimal places. I wonder if there is an function that allows me to round raster values to values x decimal places? There is the option round() in r.mapcalc, but that rounds the raster values to nearest integer. I can work with integer values, using e.g., r.mapcalc "output = round(input * 1000)". But an option to round values would be more convenient. Any suggestion?

Rgds

Paulo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130501/1aa7a70f/attachment.html>


More information about the grass-user mailing list