On Mon, Jan 9, 2012 at 8:42 PM, leonidas <[email protected]> wrote: > I created a raster using *r.grow.distance* > I need to rescale that file to a scale 0-255 but in reverse order where high > values in distance file will be converted in low values to the rescaled > file. > I'm using the following command: > * > * > But the output file has a range 60-255 > What's going wrong? > Is there any better way to do that?
Try eval `r.univar -g map=myrast` r.mapcalc "myrast.invscaled = round((1.0 - myrast / $max) * 255.0)" Original 0 will be 255, original maximum value will be 0, using round() in order to get an integer map with rounded values which can be exported as type Byte. HTH, Markus M _______________________________________________ grass-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-user
