Hi Janet,

you could run r.report:
r.report map=patches,landcover

But the output is not easily parseable. r.report internally runs r.stats:

r.stats -a  input=patches,landcover separator=comma

you get output like (patch id, landcover id, area):
2,1,1205379.000000
1,5,938148.750000
3,1,904034.250000
2,3,557203.500000
1,1,512529.750000
1,4,361451.250000

so you need to postprocess it then.



On Wed, Jun 5, 2024 at 8:10 PM Janet Choate via grass-user <
[email protected]> wrote:

> Hi GRASS community,
> I downloaded land cover data from NLCD and reclassed values into 6
> categories to generate a vegetation/landcover type raster (tree, shrub,
> grass, non-veg, water, developed) that is composed of IDs (i.e. 11=tree,
> 5-shrub, etc...)
> I also have a 90 meter patch raster.
> Any given 90 meter patch may have more than one vegetation type
> ID occurring in it.
> I would like to generate percent coverage maps to find the percent that
> each vegetation type occupies of each patch (i.e. patch 1 is composed of
> 60% tree, 30% shrub, 10%grass).
> Is it possible to compute percent cover from a vegetation type ID map?
> Any advice would be much appreciated, I have unsuccessfully tried to do
> this in GRASS as well as R.
> thank you,
> Janet
>
> --
> Tague Team Lab Manager
> 1005 Bren Hall
> UCSB, Santa Barbara, CA.
> _______________________________________________
> grass-user mailing list
> [email protected]
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to