[GRASS-user] Re: Filling Null values in a MODIS image

Markus Metz markus.metz.giswork at googlemail.com
Wed Aug 4 09:12:29 EDT 2010


Hanlie Pretorius wrote:
>
> Thanks for all the replies. I first tried finding the NULLS using
> r.mapcalc, and it turns out that the NULLS are the cells in the GRASS
> region (rectangular), but outside my study region (irregular
> geographical border). I was under the misconception that g.region set
> to a raster file functions like a mask.
>
Only the N S E W bounds, no irregular border, a MASK would be required here.

> About the r.neighbors procedure, why is it necessary to follow with
> r.patch? Surely the result of r.neighbors will be without NULLS?

That depends on the moving window size and the size of NULL areas. If
all cells in a moving window are NULL, the result should also be NULL.
Patching makes sense only for time series of data like temperature or
vegetation indices. For land cover type, patching with different years
might not be desired.

> I did
> find, though, that r.neighbours resulted in raster with extended
> borders compared to the original, which makes sense. One would then
> have to clip it again to the study area. Or use a mask of the original
> area before running r.patch?

Before doing any analysis or processing, I would set the region to the
raster including its resolution, create a MASK for the study area
maybe with a buffer around, zoom to the MASK with g.region zoom=MASK,
just to be sure align again the region to the raster resolution with
g.region align=modis_land_cover_type1_2001_primary, only now start
processing.

In this particular case, the most conservative solution would probably
be to reclassify all NULL cells as unclassified (there should be a
category value for unclassified).

Markus M


More information about the grass-user mailing list