[GRASS-user] Concatenate raster values

Moritz Lennert mlennert at club.worldonline.be
Tue May 30 09:00:59 PDT 2017


Le Tue, 30 May 2017 17:34:59 +0200,
Nikos Alexandris <nik at nikosalexandris.net> a écrit :

> Dear community,
> 
> is it possible to concatenate raster pixel values using r.mapcalc
> or/and existing modules?

Pixel values are numerical by definition, so I wouldn't think so.

> 
> 
> Something like the following examples
> 
> - expression = "product_20 = concatenate(20, input_map)":  a value of
> 88 in the "input_map" would mean the value 2088 (or 20088) in the
> output "product_20" map.

Just find out what the highest value your input map and go to an order
of magnitude high enough to do this (i.e. if max(input_map)<100):

"expression = product20 = 2000 + input_map"

> 
> - expression = "product_25 = concatenate(25, input_map)":  a value of
> 13 in the "input_map" would result in the value 2513 (or 25013) in
> the output "product_25" map.
> 
> - expression = "product_nb = concatenate( product_20, product_25):
> finally, the output pixel value, derived from the above examples,
> would be "2008825013".

product_nb = product_20 * 10000 + product_25

?

Moritz


More information about the grass-user mailing list