[GRASS-user] v.edit break lines at coordinates

Johannes Radinger johannesradinger at gmail.com
Fri Mar 13 03:53:22 PDT 2020


Hi GRASS users,

maybe someone of you can explain me following problem (of understanding) I
am facing:
I want to break a single line into several. More specifically, I am using
v.edit with the option break and two coordinate pairs to break a single
line. I'd expect that breaking a single line at two points would result in
three lines; However this results in 4 categories?!

Here a small example using the NC dataset:
#################################
# Extract single line for testing
v.extract --o input=streams at PERMANENT cats=92551 output=selected_stream

# Break line at two point locations and clean (recommended after v.edit
break)
v.edit map=selected_stream tool=break threshold=30
coords='635861,224469,635793,224553'
v.clean --o input=selected_stream output=selected_stream2 tool=rmdupl

# Add categories to layer 2 to check
v.category --o input=selected_stream2 layer=2 output=selected_stream3
option=add
v.db.addtable map=selected_stream3 layer=2
d.vect -c map=selected_stream3 at test4 layer=2 label_layer=2
attribute_column=cat
####################################

So the display shows three colors which makes sense as these would be the
three lines that I'd expect from breaking a single line at two points. But
there are four categories (that are also listed in the attribute table).
Can anyone explain that to me, what I am doing wrong; or even better, what
would you recommend to do if I want to break a line at two coordinates into
three lines?

Thank you for your help!
Johannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20200313/2b073530/attachment.html>


More information about the grass-user mailing list