Filling holes in a map

I have rasterized a vector map, using v.to.rast. As a result of
this I got some holes in my map inherent due to faulty digitizing. How can
I remove these holes. The map is actually a basins map.

Nalneesh Gaur, River Forecast Center, TULSA

Date: Mon, 14 Feb 1994 11:03:33 -0500
From: James Darrell McCauley <mccauley@ecn.purdue.edu>
To: grassu-list@max.cecer.army.mil
Subject: Re: Filling holes in a map

Nalneesh Gaur (ngaur@apwk01g3.abrfc.noaa.gov) writes on 14 Feb 94:

I have rasterized a vector map, using v.to.rast. As a result of
this I got some holes in my map inherent due to faulty digitizing. How can
I remove these holes. The map is actually a basins map.

you might try a sort of restricted median filter. That is, only
apply the filter if the pixel being examined is zero. This can
be done with r.mapcalc.

If you know what you wish to patch it with, value-wise, you can create a
raster file with r.digit, then use r.patch to patch whatever you draw
on the screen "behind" your original map. r.patch will look to the
second layer only where there is a zero value in the first layer...
thus allowing you to easily fill holes in a raster map with a second
raster map.

Good Luck!

Susan Stitt sstitt@its.nbs.gov National Biological Survey
                                       Information & Technology Services