[GRASSLIST:2585] Re: v.to.rast aggressiveness

Glynn Clements glynn.clements at virgin.net
Thu Feb 12 20:43:24 EST 2004


Hamish wrote:

> I'm noticing v.to.rast is rather aggressive -- (all versions 5.0,5.3,5.7)
> 
> It will change many raster cells with only a little bit of vector line in
> it to a hit, rather than checking which side of the cell's centroid the
> area is on..?
> 
> This has bad implications if you want to create masks covering areas
> both one side or the other, as it will always bias towards the side of
> the area vs. the negative. (say in/out of a lake's shoreline)

I find that rather odd, as G_plot_polygon() appears to shrink the
polygon which it is given.

AFAICT, much of src/libes/gis.c is bogus; it should probably be using
floor(x + 0.5) consistently. However, given my experience from
XDRIVER[1], I'm reluctant to try to fix it, as there is probably code
which relies upon the existing behaviour.

[1] XDRIVER, libraster, libdisplay and various d.* programs had a
number of +1/-1 "fudge" factors, which mostly cancelled each other
out. Once I fixed one, I had to go back up the chain and fix anything
which was relying upon the old behaviour.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list