[GRASS-user] Filling Null values in a MODIS image
Markus Metz
markus.metz.giswork at googlemail.com
Wed Aug 4 04:51:00 EDT 2010
Apart from the region resolution, it's land cover classes, r.fillnulls
will produce nonsense data: floating point. Rather use r.neighbors
with a modal filter, patch the original with the filtered map, that
would replace NULLs with the most common surrounding land cover type.
Markus M
Hanlie Pretorius wrote:
> Hi,
>
> I have a MODIS land cover image that contains NULL values according to r.univar:
> -----
> r.univar map=modis_land_cover_type1_2001_primary at PERMANENT
> total null and non-null cells: 41884
> total null cells: 17145
> -----
>
> So, I tried to fill it with r.fillnulls and I get the following:
> -----
> r.fillnulls input=MCD12Q1.A2001001.005_land_cover_type1 at PERMANENT
> output=MCD12Q1.A2001001.005_land_cover_type1_filled
> Locating and isolating NULL areas...
> Reading input raster map <r_fillnulls_1911 at PERMANENT>...
> Writing output raster map <r_fillnulls_1911.buf>...
> Creating interpolation points...
> Extracting points...
> Building topology for vector map <vecttmp_fillnulls_1911>...
> Registering primitives...
> 0 primitives registered
> 0 vertices registered
> Building areas...
> 0 areas built
> 0 isles built
> Attaching islands...
> Attaching centroids...
> Number of nodes: 0
> Number of primitives: 0
> Number of points: 0
> Number of lines: 0
> Number of boundaries: 0
> Number of centroids: 0
> Number of areas: 0
> Number of isles: 0
> r.to.vect complete.
> Interpolating 0 points
> Not sufficient points to interpolate. Maybe no hole(s) to fill in the
> current map region?
> Removing raster <MASK>
> Removing raster <r_fillnulls_1911>
> Removing raster <r_fillnulls_1911.buf>
> Removing raster <r_fillnulls_1911_filled>
> Raster map <r_fillnulls_1911_filled> not found
> <r_fillnulls_1911_filled> nothing removed
> Removing vector <vecttmp_fillnulls_1911>
> (Wed Aug 4 10:18:22 2010) Command finished (0 sec)
> -----
>
> Output of g.region -p:
> -----
> g.region -p rast=modis_land_cover_type1_2001_primary at PERMANENT res=0.00423094
> projection: 3 (Latitude-Longitude)
> zone: 0
> datum: wgs84
> ellipsoid: wgs84
> north: 27:19:08.833466S
> south: 28:30:53.475952S
> west: 28:03:57.840271E
> east: 28:41:37.727966E
> nsres: 0:00:15.210751
> ewres: 0:00:15.269511
> rows: 283
> cols: 148
> cells: 41884
> -----
>
> Output of r.info:
> -----
> r.info map=modis_land_cover_type1_2001_primary at PERMANENT
> +----------------------------------------------------------------------------+
> | Layer: modis_land_cover_type1_2001_p Date: Thu Jul 29 15:17:55 2010
> | Mapset: PERMANENT Login of Creator: hanlie
> | Location: world_wgs84
> | DataBase: /media/0847147784/grassdata
> | Title: ( MCD12Q1.A2001001.005_land_cover_type1 )
> | Timestamp: none
> |----------------------------------------------------------------------------
> |
> | Type of Map: raster Number of Categories: 14
> | Data Type: CELL
> | Rows: 11957
> | Columns: 6277
> | Total Cells: 75054089
> | Projection: Latitude-Longitude
> | N: 27:19:08.833466S S: 28:30:53.475952S Res: 0:00:00.36001
> | E: 28:41:37.727966E W: 28:03:57.840271E Res: 0:00:00.36002
> | Range of data: min = 1 max = 14
> |
> | Data Description:
> | generated by r.in.gdal
> |
> | Comments:
> | r.in.gdal input="F:\Hanlie\UCT\M.Sc\Data\modis\MOD12Q1\MCD12Q1.A2001\
> | 001.h20v11.005.2009342153812_land_cover_type1.tif" output="MCD12Q1.A\
> | 2001001.005_land_cover_type1"
> |
> +----------------------------------------------------------------------------+
>
>
> 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?
>
> Thanks
> Hanlie
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
More information about the grass-user
mailing list