[GRASS-user] How to add new columns of number of nodes and, length of line vector ?

Richard Chirgwin rchirgwin at ozemail.com.au
Mon Oct 31 03:32:32 EDT 2011

On 1/11/11 5:29 AM, grass-user-request at lists.osgeo.org wrote:
> Message: 3
> Date: Mon, 31 Oct 2011 16:18:40 +0900
> From:SGW00412 at nifty.com
> Subject: [GRASS-user] How to add new columns of number of nodes and
> 	length of line vector ?
> To:grass-user at lists.osgeo.org
> Message-ID:<JxY3DIIYso6QrYAhrf6yusEA1 at nifty.com>
> Content-Type: text/plain; charset=ISO-2022-JP
> Hi grass users;
> We traced bird migration by marine radar.
> By using graphic analyze of radar monitor capture on PC, we had  many line
> vectors of bird flight.
> I would like to add new columns of the number of node and lenght of line vector,
> So;
> v.db.addcol line_db columns="num_node int"
> v.db.addcol line_db columns="length double precision"
> After that, to update and fill two columus, what commands do I use ?
> I think...can I use SQL query with spatilite...is it right ?
> Best
> Yasuo shimada ( Japan Weather Association )
Yasuo -

For length:
v.to.db map=line_db option=length units=k column=length

This would put the length of the line into the column, in kilometers. If 
you want some other unit, check v.to.db --help to choose the right 

I don't know how to check the node count - someone else may help there.


More information about the grass-user mailing list