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

Hamish hamish_nospam at yahoo.com
Sun Apr 11 04:48:12 EDT 2004


On Fri, 13 Feb 2004 01:51:56 +1300 Hamish wrote:
  http://grass.itc.it/pipermail/grassuser/2004-February/024709.html


> > 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)


Glynn wrote:
> 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.


I'm having another try at this and it appears the problem goes away if I
export the vector file to 5.3 (& run v.alabel and v.support). This
solves my immediate problem.

I'm not sure at this point what I was doing to make it show up in 5.0 &
5.3 before or if I was mistaken or something else is different now.
Maybe the date had something to do with it.

Trying with 5.7 from last week still produces bad results.

see attached before & after pics. v2rast_1.png is using 5.7's v.to.rast,
v2rast_3.png is using 5.3's version.

Can someone confirm? Is this a 5.7 vector bug?


?,
Hamish
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2rast_1.png
Type: image/png
Size: 5894 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20040411/8c51a16d/v2rast_1.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2rast_3.png
Type: image/png
Size: 6349 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20040411/8c51a16d/v2rast_3.png


More information about the grass-dev mailing list