[GRASS-user] Re: Add DB entries to vector line (after v.split)

Hi, wittich.

– firstly you should delete old categories from your segments’ lines (they relate to the initial 3 lines):
v.category in=lines_split out=lines_split_nocats opt=del

– then add new cats to segmented lines:
v.category in=lines_split_nocats out=lines_split_newcats opt=add

As a promotion: there is a small shell-script <v.to.equidist> on GRASS-Addons page that generates vector points or line segments along a given vector line(s) with the equal distances (uses v.segment) and populate tables with cats, length etc.

Date: Sun, 23 Oct 2011 10:26:06 -0700 (PDT)
From: wittich <vwittich@gmail.com>
Subject: [GRASS-user] Add DB entries to vector line (after v.split)
To: grass-user@lists.osgeo.org
Message-ID: <1319390766722-6922423.post@n2.nabble.com>
Content-Type: text/plain; charset=us-ascii

Hi there,

I try to find a way to give every line segment in my vector file a db entry.
I’ve create 3 lines and split them into 50m segments. Now I want to do
several calculations with it. Therefore I need for each segment a row in the
db.

How can I create a entry for each segment?

v.info split_lines
Number of lines: 598

v.db.select split_lines
cat
1
2
3

I would appreciate if someone can explain me what I do wrong, I tried
already everything I could found without success (eg. v.dissolve,
v.category, v.centroids, and others)

regards Valentin


View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-DB-entries-to-vector-line-after-v-split-tp6922423p6922423.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi Alexander,

thx for your answer. I tried the v.category function but it seams like it
doesn't work. And in case that it would work, I would lost the original
categories the lines belongs to, don't I?

Alexander Muriy wrote:

v.category in=lines_split out=lines_split_nocats opt=del
v.category in=lines_split_nocats out=lines_split_newcats opt=add

lines_split_nocats and lines_split_newcats give me the following

v.db.select ...
cat
1
2
3

It seams like the Option 'del' doesn't work... I tried to delete the table
as well, but if I built it again, I've the old categories. But anyway my
workaround works.

regards Valentin

ps: I'm gonna try your shell-script (v.to.equidist), as soon I'll have
installed the GRASS-Addons. Right now it didn't find the grass/gis.h while
he compiled it...

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-DB-entries-to-vector-line-after-v-split-tp6922423p6925911.html
Sent from the Grass - Users mailing list archive at Nabble.com.