[GRASS-user] Question about v.to.rast

S. Koukoulas (listes) sotkouklistes at gmail.com
Sat Jun 21 12:02:50 PDT 2014


This is a late reply, but you might still find it useful.

You can get rid of single (or multiple) isolated pixels  by cleaning the
raster with the following commands:

r. reclass.area
r.neighbors (with the selection option - appears only in version 7).

The idea is to reclassify your raster using the area of a single or
multiple isolated pixels ( eg. estimate what is the area of a single
pixel in ha and use it to reclassify your raster), producing a map that
will exclude the pixels selected below this area threshold. You will end
up with a raster with nulls in place of the rejected pixels.

Then you can use the r.neighbors to replace these nulls (and only these,
if you use the selection option) with the mode (if it is an
integer/categorical raster otherwise use the appropriate statistic) of
the pixels values in the specified neighborhood. This is done by using
the raster resulted from the r. reclass.area in the selection option and
the original raster in the input.  You will end up with a much more
"clean" raster to convert  to vector.

best regards,
sotiris




On 06/16/2014 02:47 PM, Thomas Adams wrote:
> All:
>
> I have used r.lake to simulate flood inundation in an urban area --
> the raster looks great! What I want to do (and have done) is to use
> r.to.vect, export the vector as a KML (which works), bring the
> simulated flood inundation map KMLs into GoogleEarth and create some
> animations from the simulated inundation, including showing rising
> flood levels inundating the city streets in 3D.
>
> I can basically do all this, except that the r.to.vect conversion
> creates a gazillion boxes that are the size of the raster pixels -- I
> don't want all the tiny boxes. What I want, is just a single (albeit,
> complex) polygon showing the flooded areas. v.dissolve will remove the
> boundaries of adjacent boxes if their cat or attributes are the same
> -- is this the way to go, namely, make all the cats or attribute
> values the same and then use v.dissolve?
>
> Or, is there is there a better way to do what I'm attempting to do?
> That is, is it best to keep the individual small vector boxes for
> reasons I'm not considering?
>
> Thank you,
> Tom
>
> -- 
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140621/35597e4b/attachment.html>


More information about the grass-user mailing list