[GRASS-dev] New directional buffering module or modified v.buffer

Trevor Wiens twiens at interbaun.com
Wed Mar 14 16:00:59 EDT 2007


I posted a question some time ago about directional or differential
buffering. I've managed to resolve my bugs and am now unsure what is the
best way to incorporate this code back into GRASS. I assume it is
desirable as I assume others may find it useful from time to time.

Largely what I did is modify v.buffer to work with an ellipse rather
than a circle for buffering (you will recall that a circle is actually
just a special case of an ellipse), so that amount of code changed is
minimal. I did however have to replicate some of the code in
Vlib/buffer.c to achieve this. I know that for actual incorporation,
this is a bad thing.

In terms of interface, the scale attribute has been replaced with
nscale, sscale, escale, and wscale for north, south .... If the scale
values are all the same (eg 1.0) then it gives the same result as
v.buffer does now. But when they are different it uses the angle from
the source line in the formula of an ellipse to calculate distance using
the two appropriate cardinal scale values.

Now I could create separate versions of the needed functions in
buffer.c or create a single modified version. In this case v.buffer
would simply be modified and no new module would need to be created. I
could however create a separate module called for example
v.buffer.ellipsoid. 

My guess is that we don't really want the code base to grow
without good reason, so it is probably best to modify the
existing routines. Since I don't really like messing with Vlib, I can
write my modifications such that if the scale values are all the same,
the original code is executed, just in case there is something odd that
I've not found in my testing.

Now I seem to have messed up my CVS access so once I get things in
condition to commit, I'll need someone to do it on my behalf.

T
-- 
Trevor Wiens 
twiens at interbaun.com

The significant problems that we face cannot be solved at the same 
level of thinking we were at when we created them. 
(Albert Einstein)




More information about the grass-dev mailing list