Re: [GRASS-user] more on v.net: break lines on nodes
Hi, I'd like to re-open a quite old thread about breaking lines in a network. the old thread: 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 I am in a similar situation: There is the main stem of a river and a contributing tributary. I want to break the main stem at the point where the tributary joins the it. I attached a screenshot with the Cat-numbers as labels and the selected section of the main stem I'd like to break (yellow). I considered three ways: 1) Use v.clean with first snapping the tributary to the mainstem and then breaking at the intersection. But I am not sure if this works as is is not an intersection (line just joins but don't intersect)!? 2) Using Moritz' approaches with v.edit - connect. Thats what I also tried but without success so far. v.edit map=Treene_test@SDM_Treene tool=connect thresh=100,100,100 cats=768,883 Selecting features... 2 of 1336 features selected from vector map Treene_test@SDM_Treene Threshold value for snapping is 100.00 0 lines connected Building topology for vector map Treene_test... 3) or with getting the end point of the tributary (v.to.db) and then use break (v.edit) and setting the ID to the section of the mainstem (and setting the threshold). I already tried also this approach and then some basic questions arose: (a) What is the difference between Cat and ID. When I break the line (with v.edit) I get only two IDs but these are actually not two lines (which can e.g. be selected with the Query vector map tool in the GUI). (b) What is a suitable threshold (10,10,10?) Can there be a to large threshold if it is snapped to the nearest feature? (c) Is it useful to set the snap flag in v.edit in such cases? Or should I use the snap tool (v.edit) as a second process. (d) As I want two real new lines (cats) which show the same attributes, what is the easiest way to go. The connect tool sounds that this should do that job but somehow I fail? Best regards, Johannes -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a attachment: Line_to_break.png___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] more on v.net: break lines on nodes
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 inline: breaklinesonnodes.png___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] more on v.net: break lines on nodes
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 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] more on v.net: break lines on nodes
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 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] more on v.net: break lines on nodes
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 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] more on v.net: break lines on nodes
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 inline: breaklinesonnodes2.png___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] more on v.net: break lines on nodes
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 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user