[GRASS-user] Defining/using MMU

Hi

I’m using landsat images (30m sp. resolution) and I’m producing a classification map over these images so I obtain a land cover map with a 30m resolution. I need to eliminate areas, classified with a class but with a an area lower than 20 ha (for example). is this possible in GRASS? and How?

Best regards,
Luisa

Hi Lisa,

I assume you're meaning you want to eliminate contigious areas whose size is
lower than 20 ha, right?

I'd suggest converting the raster into a vector with r.to.vect and then
running v.to.db to compute the area of each polygon. The polygons will be
have accepted the values of the cells they were made from and if several
cells were adjacent with the same value they'll be made into one polygon.
Then you can use v.edit to delete all the polygons that don't have a large
enough area. After that, a quick trick would be to convert the vector map
back into a raster map and use r.mapcalc to divide it by itself so that
you've only got values of 1 or NULL and then multiplying that by your land
use raster. The result should be all the land use classes you calculated,
but the cells that were multiplied with NULL will now also have the value of
NULL.

Maybe that's not the most elegant way to do things, but it's the one that
popped into my mind. Anybody have a better method?

Best,
Daniel
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Defining-using-MMU-tp5256926p5256983.html
Sent from the Grass - Users mailing list archive at Nabble.com.

LeeDaniel pisze:

Hi Lisa,

Maybe that's not the most elegant way to do things, but it's the one that
popped into my mind. Anybody have a better method?
  

yes, new add-on module r.area can do that. First you need run r.clump to create unique areas next, run r.area to remove areas smaller than treshold (in cells not in ha) and return binary map with 1 (leave) and 0 (remove)

r.area -b input=classified_map output=bin_map

next
r.mapcalc removed=if(bin_map==1,classified_map,any_value_or_null)
that all.

second option is to use r.reclass.area. it work in ha so it is probably what you need.

Best,
Daniel