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

2010-08-04 Thread Hanlie Pretorius
2010/8/4, Hamish hamis...@yahoo.com:
 Hanlie wrote:
  |   Rows: 11957
  |   Columns:  6277
 ...
 I have tried to see the NULLS by displaying everything in
 white, except for NULLS displayed in red, but I didn't see
 anything.

 Does anyone know how I can find out if there are actually
 NULL value and where they are?

 try zooming in. Unless you have a 12000x7000 monitor, some cells will be
 hidden.

 extract with r.mapcalc and buffer with r.buffer if they are still hard to
 find.


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.

About the r.neighbors procedure, why is it necessary to follow with
r.patch? Surely the result of r.neighbors will be without NULLS? 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?

Hanlie
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2010-08-04 Thread Markus Metz
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
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user