[GRASS5] v.buffer now does v.bubble

Hamish hamish_nospam at yahoo.com
Tue Nov 8 20:53:27 EST 2005


> > v.buffer now can do dynamic buffer sizes with values taken from an
> > attribute column and scale factor. Probably buggy so please
> > test/fix.
..
> are you sure it works? I am almost sure it does not.

I tested it on some simple point, line, and area input maps and it
seemed to work ok. Obviously not enough. "Partially functional" might be
a good way to describe it. Boundaries are generated correctly, centroids 
are not always correct.

screenshots:
http://bambi/hamish/grass/v_buffer_lines_9Nov2005.png
 (d.vect cat=1-99999, buffer size taken from number of road lanes
   column, note areas filled in error)

http://bambi/hamish/grass/v_buffer_points_9Nov2005.png
http://bambi/hamish/grass/v_buffer_points2_9Nov2005.png
 (note ok centroid placement in this case)


> The first part which cunstructs buffer boundaries is OK.
> The second which decides which areas are in buffer
> (function area_in_buffer ) is using constant buffer size.
> It will not be so easy, you have to rewrite
> area_in_buffer() function to always check the right buffer
> size for each feature in neighbourhood.

Yes.......... I didn't get that far down into the code. so centroid 
placement can be bad for the 2 calls to area_in_buffer(), as buffer
and tolerance are taken from last category encountered. Not sure
what happens when entire column is null, zero, or negative. "buffer"
gets used uninitialized I guess.

On the positive side only the new code is broken and using a
constant buffer will still work the same, so we don't have to revert
the code while we try for a fix. And I think it is useful even now.

I am forgetting the module that adds missing centroids.. maybe document
v.extract type=boundary + that as a work around until it is fixed.
Or is there a problem whether or not islands/holes get a category number
when they shouldn't then? 

For a v.bubble replacement it isn't very good to use this module as
small bubbles will be disolved in bigger bubbles. Better for people to
use d.vect.chart or the v.buffer+v.patch loop for that I guess.


I will discuss possible fixes in another email. (still have to study the
different point in polygon tests & a different one I have used in the past)



Hamish




More information about the grass-dev mailing list