maven wrote:
http://trac.osgeo.org/grass/ticket/654
Is this bug fixed? If yes , in which version? I
download the grass6.4 rc5 and I found the problem still exist.
the bug is in RC5.
it has been fixed in the source code (SVN) but a new release has not
been issued yet incorporating that change.
the bug is not in the earlier wingrass release, r37703 (which is just
a few days younger).
Hamish
Hallo!
Is there an easy solution to insert values from v.net report into it's
table?
I did it external with sqlite creating a new table from a join and
connected my vectormap to that. But when I eg. add a node, I don't want
to redo the hole procedure.
Information given from v.net nreport consists of cat and a list of cats
from lines each node is connected to (see PS). It seems more complicated
to update this inside grass. -> Is it useful to get to know how grass
deals with nodes-lines in network internally??
Thanks,
Achim
PS:
1 1
2 1
3 2
4 2
5 3
6 3
7 4,5,386
8 4
9 5
10 6,222,264
Hi,
another question..:
is it possible to break lines from the network on nodes?
I need that to describe and query connections between the nodes.
Thanks again!
Achim
2009/7/3 Hamish <hamish_b@yahoo.com>
maven wrote:
http://trac.osgeo.org/grass/ticket/654
Is this bug fixed? If yes , in which version? I
download the grass6.4 rc5 and I found the problem still exist.
the bug is in RC5.
it has been fixed in the source code (SVN) but a new release has not
been issued yet incorporating that change.
the bug is not in the earlier wingrass release, r37703 (which is just
a few days younger).
I have tried to find a earlier version,however I could only find the grass 63, can anyone provide a link to this r37703?
Hamish
On 03/07/09 12:10, achim wrote:
Hi,
another question..:
is it possible to break lines from the network on nodes?
If you add a node to the network it is either:
- on an intersection already if you use v.net operation=nodes
- on the end of a line if you use v.net operation=connect
So, I don't really see the possibility of having nodes on a network line. Could you elaborate ?
Moritz
Hi,
as an explanation I draw a little picture...
I like to have each line extra to have a common node on each crossing. I
would to have that in order to try handling tree structures and some
analysis in a database.
Thanks,
achim
Moritz Lennert schrieb:
On 03/07/09 12:10, achim wrote:
Hi,
another question..:
is it possible to break lines from the network on nodes?
If you add a node to the network it is either:
- on an intersection already if you use v.net operation=nodes
- on the end of a line if you use v.net operation=connect
So, I don't really see the possibility of having nodes on a network
line. Could you elaborate ?
Moritz
(attachments)

On 03/07/09 11:45, achim wrote:
Hallo!
Is there an easy solution to insert values from v.net report into it's
table?
I did it external with sqlite creating a new table from a join and
connected my vectormap to that. But when I eg. add a node, I don't want
to redo the hole procedure.
Information given from v.net nreport consists of cat and a list of cats
from lines each node is connected to (see PS). It seems more complicated
to update this inside grass. -> Is it useful to get to know how grass
deals with nodes-lines in network internally??
No, not necessary. Just use a script such as this (assuming that the table linked to your map contains a start_cat and a stop_cat column defined as integer):
v.net YourMap operation=report | awk '{printf"UPDATE NameOfTableLinkedToYourMap set start_cat=%i,stop_cat=%i where cat=%i;\n", $2, $3, $1}' | db.execute
This can take quite some time if you have lots of lines in your network, so you can limit to the cat value of the new node with something like this (untested):
v.net YourMap operation=report | awk '{if($2==NewNodeCat || $3==NewNodeCat)printf"UPDATE NameOfTableLinkedToYourMap set start_cat=%i,stop_cat=%i where cat=%i;\n", $2, $3, $1}' | db.execute
Moritz
So, I don't really see the possibility of having nodes on a network
line. Could you elaborate ?
I like to do something like "zonal statistics" on vector areas. Not with
rasters, but with vectors inside. That means eg:
"length of all roads of a kind for every area". Or: "longest road on
that area in an network of roads".
Maybe there is a possibility to "cut out" line features on the border of
areas?
achim
On 07/07/09 11:39, achim wrote:
So, I don't really see the possibility of having nodes on a network
line. Could you elaborate ?
I like to do something like "zonal statistics" on vector areas. Not with
rasters, but with vectors inside. That means eg:
"length of all roads of a kind for every area". Or: "longest road on
that area in an network of roads".
Maybe there is a possibility to "cut out" line features on the border of
areas?
v.overlay operator=and: the result gives you an attribute table combining both original attribute tables and thus allows easy summary statistics through SQL queries.
Moritz
On 07/07/09 11:15, achim wrote:
Hi,
as an explanation I draw a little picture...
I like to have each line extra to have a common node on each crossing. I
would to have that in order to try handling tree structures and some
analysis in a database.
From the picture, your talking about snapping more than breaking lines ?
v.edit ?
v.clean ?
Moritz
Thanks,
achim
Moritz Lennert schrieb:
On 03/07/09 12:10, achim wrote:
Hi,
another question..:
is it possible to break lines from the network on nodes?
If you add a node to the network it is either:
- on an intersection already if you use v.net operation=nodes
- on the end of a line if you use v.net operation=connect
So, I don't really see the possibility of having nodes on a network
line. Could you elaborate ?
Moritz
------------------------------------------------------------------------
Sorry, not very clear... They are "snapped"!
I wanted to show that I have
1) two lines (two cats) with no common nodes on the network
2) I want the longer to be broken on the node of the longer one in order
to have a common node (and three lines with three cats)
achim
Moritz Lennert schrieb:
On 07/07/09 11:15, achim wrote:
Hi,
as an explanation I draw a little picture...
I like to have each line extra to have a common node on each crossing. I
would to have that in order to try handling tree structures and some
analysis in a database.
From the picture, your talking about snapping more than breaking lines ?
v.edit ?
v.clean ?
Moritz
Thanks,
achim
Moritz Lennert schrieb:
On 03/07/09 12:10, achim wrote:
Hi,
another question..:
is it possible to break lines from the network on nodes?
If you add a node to the network it is either:
- on an intersection already if you use v.net operation=nodes
- on the end of a line if you use v.net operation=connect
So, I don't really see the possibility of having nodes on a network
line. Could you elaborate ?
Moritz
------------------------------------------------------------------------
On 07/07/09 12:18, achim wrote:
Sorry, not very clear... They are "snapped"!
I wanted to show that I have
1) two lines (two cats) with no common nodes on the network
2) I want the longer to be broken on the node of the longer one in order
to have a common node (and three lines with three cats)
Sorry, I still don't understand: what do you mean by "the node of the longer one" ? If each line is a straight line, then you have two nodes, one at each end. So, do you mean that you want to break the longer line, thus creating two new nodes, representing the new end points of the two parts and then snap these two nodes back together again and snap a third node (from the other line) to that same place ?
If that is what you want to do, you can use the 'connect' tool in v.edit (see "Connect lines" in the man page).
If you want to break you line at the coordinates of a specific node, you can do it this way:
v.edit tool=break cat=CatOfTheLineToBreak coords=CoordinatesOfYourNode thresh=
v.edit tool=snap cat=CatOfTheBrokenLine,CatOfOtherLine thresh
You can get the coordinates of your nodes with v.to.db.
Hope this helps,
Moritz
v.edit tool=break cat=CatOfTheLineToBreak coords=CoordinatesOfYourNode
thresh=
v.edit tool=snap cat=CatOfTheBrokenLine,CatOfOtherLine thresh
You can get the coordinates of your nodes with v.to.db.
Thats what I was looking for. Thank you very much, Moritz! I didn't
recognized the break tool...
Sorry for complicated problem description. I am still a little confused
why v.net produces such lines that no new (poly)lines begin on each node
(picture).
So I write a script with "v.edit tool=break" that does that for me.
(And thank you very much for tip how to insert a new line on a network.
I will have a closer look at the significant awk!)
achim
(attachments)

On 07/07/09 14:23, achim wrote:
Sorry for complicated problem description. I am still a little confused
why v.net produces such lines that no new (poly)lines begin on each node
(picture).
I don't think that v.net produces any lines, except for the connecting lines it creates when using option=connect. So whatever line structure you have in your original file is the one you are going to keep.
If you are interested in the analysis of network structures, you might be interested in this:
http://grass.osgeo.org/wiki/GSoC_Network_Analysis
Moritz
Hi all,
I try to break a couple of lines on specified points (nodes in a network
to get separated lines).
I do this with for one example-point successfully:
v.edit map=laflo_break@achim layer=1 type=line tool=break ids=0-9999999
thresh=-1,0.000001,0.000001 coords=32.6958333333333,8.67083333333333
but doing this with a list of more than 6 coors or having the same coor
twice in the list, I get the "Attempt to delete dead feature"-error.
Is there a limiting number of coords for v.edit or is it something else?
What does grass try when it "Attempt to delete dead feature"
Thanks,
Achim
PS: after error message the topology of vector-file is destroyed:
WARNING: Size of 'coor' file differs from value saved in topology file
WARNING: Please rebuild topology for vector map
Hello,
there is another "strange result" I don't understand. I attach a picture
to show, what I mean.
I guess it has to do with producing new start- and end-points and so a
new line is born?
Anyone an idea how to avoid this?
I try to break a couple of lines on specified points (nodes in a network
to get separated lines).
I do this with for one example-point successfully:
v.edit map=laflo_break@achim layer=1 type=line tool=break ids=0-9999999
thresh=-1,0.000001,0.000001 coords=32.6958333333333,8.67083333333333
but doing this with a list of more than 6 coors or having the same coor
twice in the list, I get the "Attempt to delete dead feature"-error.
Is there a limiting number of coords for v.edit or is it something else?
What does grass try when it "Attempt to delete dead feature"
I now doing this one by one. ...not elegant but it works. Just have to
wait...
Achim
(attachments)

Hi,
2009/8/14 achim <ak7@jupiter.uni-freiburg.de>:
there is another "strange result" I don't understand. I attach a picture
to show, what I mean.
I guess it has to do with producing new start- and end-points and so a
new line is born?
Anyone an idea how to avoid this?
I try to break a couple of lines on specified points (nodes in a network
to get separated lines).
I do this with for one example-point successfully:
v.edit map=laflo_break@achim layer=1 type=line tool=break ids=0-9999999
thresh=-1,0.000001,0.000001 coords=32.6958333333333,8.67083333333333
but doing this with a list of more than 6 coors or having the same coor
twice in the list, I get the "Attempt to delete dead feature"-error.
Is there a limiting number of coords for v.edit or is it something else?
What does grass try when it "Attempt to delete dead feature"
I now doing this one by one. ...not elegant but it works. Just have to
wait...
both reported issues are serious bugs of v.edit. Can you fill trac
ticket for that? Just to avoid that it will forgotten. I will try to
take a look ASAP.
Martin
--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa
both reported issues are serious bugs of v.edit. Can you fill trac
ticket for that? Just to avoid that it will forgotten. I will try to
take a look ASAP.
I'll write a report then.
Do you (or anyone else) have an idea how else to get the lines splitted
on these points?
Achim
Hi all,
so I wrote a little script as workaround I want to share
while renew_cats just looks like:
v.category input=$1 output=$1_nocat option=del type=$3 layer=$2 --o
v.category input=$1_nocat output=$1 type=$3 layer=$2 --o
Its really slow, but does its job,
Greetings,
Achim
achim schrieb:
both reported issues are serious bugs of v.edit. Can you fill trac
ticket for that? Just to avoid that it will forgotten. I will try to
take a look ASAP.
I'll write a report then.
Do you (or anyone else) have an idea how else to get the lines splitted
on these points?
Achim
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
(attachments)
break_rivernetwork_correct.sh (1.59 KB)
On 18/08/09 15:34, achim wrote:
Hi all,
so I wrote a little script as workaround I want to share
Thanks for sharing this. One remark:
**************
## update network table with start,end point cats
## takes a long time!!!
v.net -c --overwrite input=$1 operation=report > line_end_cats.txt
while read line; do
cat=$(echo $line | cut -d' ' -f1)
start=$(echo $line | cut -d' ' -f2)
end=$(echo $line | cut -d' ' -f3)
## update network table, line layer
sqlite3 /home/achim/grass/sqlite_db "UPDATE $1
SET start=$start,end=$end WHERE cat = $cat;"
done < line_end_cats.txt
++++++++++++++++++++
Can't you do this with v.to.db option=start / end ? Don't know if this is faster, though...
In any case, you can probably speed it up by putting all your SQL statements into a file and then executing sqlite on that file outside the loop. Database connections always create quite a lot of overhead.
Moritz