How do I get for each v.to.points
point an ID in the database (DB).
So far I splited the line (each 10m) but it returns only one DB entry for each original line.
v.db.select line
cat|Id|Name
1|1|Line 1
2|2|Line 2
# split the lines every 10m
v.to.points in=line out=line_points dmax=10
# check the result
v.db.select line_points
cat|Id|Name
1|1|Line 1
2|2|Line 2
Each point should have its own DB entry. The result should be:
v.db.select line_points
cat|Id|Name
1|1|Line 1
2|1|Line 1
3|2|Line 2
4|2|Line 2
Workaround: So far my workaround is, to export (v.out.ogr
) the points as shape and import (v.in.ogr
) it again. Then each point has his own ID. But there must be a smarter way to do that!
v.category
. What I tried is the following commandv.category in=line_points option=add out=line_points2
. I posted the question 'cuz I have it already for quite a while and work since ever with my workaround, but I felt alway its not the best method to do it.