[GRASS-user] snap point to line/break line at given points

Johannes Radinger JRadinger at gmx.at
Sun Apr 24 08:36:13 EDT 2011


Hi Micha,
Hi other GRASS users!

Am 23.04.2011 um 18:01 schrieb Micha Silver:

> Hi Johannes:
> 
> On 04/22/2011 05:15 PM, Johannes Radinger wrote:
>> 
>> Am 22.04.2011 um 13:22 schrieb Moritz Lennert:
>> 
>>> On 22/04/11 11:34, Johannes Radinger wrote:
>>>> About my situation: I've got a river network, which
>>>> is a polylinefeature set with 43 lines (43 IDs) included (tree-like shape of a rivernet)
>>>> all with the same cat-value (1).
>>>> 
>>>> Now I would like to unite/merge the lines to one feature (1 ID) if that is possible
>>>> and break that single element at given points with v.edit...Because if I break
>>>> now at around 40 positions I get over 80 segements (40 old segements and which
>>>> are broken again at different positions) but there should  be only
>>>> 41 or so...
>>>> 
>>>> so how can I handle that and assign unique cat values for each segment...(at the
>>>> moment the don't have to be the same like the breakpoints, just unique values)
>>>> 
>>>> any suggestions?
>>> v.edit tool=catadd id= ?
>> 
>> Sorry but I am still confused how to do the break.
>> 
>> In the Attachment there is a GRASS-exported shp.-file with my
>> rivernet consisting of 43 single lines.
>> 
>> I want to break that river at e.g. 3521021.43671,6041340.79067
>> which is one point (out of others) along the river.
>> 
> 
> Here's what I tried:
> 
> GRASS 6.4.0 (WGS84):~/geodata > v.edit river_gen tool=break coords="3521021.43671,6041340.79067"
> Selecting features...
> 100%
> 1 of 43 features selected from vector map <river_gen at PERMANENT>
> 100%
> 1 lines broken
> Building topology for vector map <river_gen>...
> Registering primitives...
> 44 primitives registered
> 17135 vertices registered
> Building areas...
> 100%
> 0 areas built
> 0 isles built
> Attaching islands...
> Attaching centroids...
> 100%
> Number of nodes: 45
> Number of primitives: 44
> Number of points: 0
> Number of lines: 44
> Number of boundaries: 0
> Number of centroids: 0
> Number of areas: 0
> Number of isles: 0
> v.edit complete.
> 
> So I there are now 44 line segments as opposed to the original 43. One got split into two. But the two new segments have the same cat number.
> Next I wiped out all the old cats:
> GRASS 6.4.0 (WGS84):~/geodata > v.category river_gen opt=del cat=1-43 out=river_gen_tmp
> and recreated new cats into a new vector:
> GRASS 6.4.0 (WGS84):~/geodata > v.category --o river_gen_tmp opt=add out=river_gen_2
> 
> In the attached image you can see that the original line segment with cat=12 (black numbers) got split into two (after the v.edit step). THe red numbers are the new cat values, and that line segment got cats 43 and 44.
> 
> Reviewing your first post I want to also note:
> I believe that GRASS's topology model will not allow you to merge the original river segments into one "polyline" (MULTILINE in other GIS). You *can* of course have polylines in GRASS, but they must consist of two line segments connected at exactly one point. In any typical river network you always have three segments intersecting: the upstream reach, the tributary and the downstream reach. 
> Others with more experience may correct me, but I think that if you must merge all the river segments into one "MULTILINE" before splitting at the new points, then you'll have to use some other tool and non-topological vector data format outside of GRASS. 


So if I understand you correctly, it is not really possible to split a river network at one point into to parts. I attached a picture to illustrate what I want (e.g. two break points in a rivernet). I think that this kind of breaking I want to do is quite common, so there's probably another solution in grass gis...


I appreciate any hints to solve that (just see the attached picture and the older posts)

thanks
/johannes


> 
> Regards,
> Micha
> 
> 
>> In the end I want two features/categories one on each side of the break.
>> 
>> what are the exact steps especially when I want to do it with several points
>> (I know the procedure with a python for loop in combination with v.edit).
>> 
>> 
>> This mail was received via Mail-SeCure System.
>> 
>> 
>> 
>> 
>> 
>> 
>>> Moritz
>>> _______________________________________________
>>> grass-user mailing list
>>> grass-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>> 
>> This mail was received via Mail-SeCure System.
>> 
>> 
>> 
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>> 
>> This mail was received via Mail-SeCure System.
>> 
>> 
> 
> 
> -- 
> Micha Silver
> Arava Development Co. +972-52-3665918
> http://www.surfaces.co.il
>  
> <river_gen.jpg>_______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

-------------- next part --------------
Skipped content of type multipart/related


More information about the grass-user mailing list