On 04.01.2008 17:32, Duffy, Garret wrote:
Hi GRASS-grazers,
I'm wondering if anyone out there has a script or has done any sinuosity measurements on vector lines?
Hi Garret,
I don't really have a script, but thought it would be a logical thing to add to the v.to.db module.
I have a map with a number of quasi-parallel vector lines and I would like to do sinuosity measurements (line length divided by node-to-node straight-line distance) on each line separately. I guess the ideal output would be the same vector map but now with the sinuosity attribute attached to each line.
I suppose you mean line length divided by the distance of the end nodes. That is at least what I have implemented.
Does anyone have any thoughts on how to do this?
I have added the option=sinuous to the v.to.db module, as it would be annoying at least to do it by hand or by script. To do it you'd first have to use v.to.db option=length, and then v.to.db option=start and v.to.db option=end Then do an update which would do the calculation. And if you use the DBF engine (which can't do [advanced] arithmetics), well then you'd have to do a select to get the values and then an update with the value calculated in the script.
Anyway, I have just committed changes to the SVN, and so maybe it will be merged to the next release?
Anyway I've attached the diff for your convenience. I hope you enjoy it
--Wolf
--
<:3 )---- Wolf Bergenheim ----( 8:>
(attachments)
sinuous.diff (6.87 KB)