[GRASS-user] Downscaling and aggregating raster categories/classes
Nikos Alexandris
nik at nikosalexandris.net
Wed Feb 27 12:37:58 PST 2013
For whom it may be of interest!
Nikos Alexandris wrote:
> I am trying to perform the following:
>
> A classified map "A" of 25m pix res. has two main categories B and C.
> Downscaling the map to 50m (map "B") results in pixels which correspond to
> 4 * 25m (original pixels).
>
> Given the region extent is aligned, three possibilities may occur (near the
> borders between categories B=11 and C=22) in terms of abundance/coverage in
> the resampled map:
>
> 1. B = C <-- Mixed (M)
> ____
>
> |B|B|
> |-----|
> |C|C|
>
> -------
>
> 2. B > C
>
> |B|B|
> |-----|
> |C|B|
>
> -------
>
> 3. B < C
>
> |B|C|
> |-----|
> |C|C|
>
> -------
..
I did:
#1
r.resamp.stats input=A output=B method=sum # map A has two cats: 11 & 12
#2
r.mapcalc "B_int = int( B )"
# 3
r.recode in=B_int out=B_int_recoded rules=RecodingRules
where RecodingRules contains:
44:44:11:11
45:45:11:11
46:46:13:13
47:47:12:12
48:48:12:12
where class B = 11, class C = 12 and a (new) Mixed class is M=13.
It would be nice to get this in one step :-)
Best, Nikos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130227/6de90bf4/attachment.pgp>
More information about the grass-user
mailing list