[GRASS-dev] [GRASS GIS] #2903: v.edit break bug with multiple coordinates

#2903: v.edit break bug with multiple coordinates
----------------------+-------------------------
Reporter: robert17 | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.4
Component: Vector | Version: 7.0.3
Keywords: | CPU: OSX/PPC
Platform: All |
----------------------+-------------------------
Hello all,

I tried to use the v.edit tool=break with several coords but it doesn't
work, although it works with each coord seperately.

More precisely, when I break one line on two coordinates, it creates
several superimposed lines each one broken on a coordinate. Whereas the
desired output should be one line broken at each coordinate.

Tested on GRASS7 through Win (OSGEO4W) and Debian
Below the commands to reproduce the bug :

v.in.ogr input='' output=''
v.edit map='' tool=break threshold=0.01 coords=x,y,x,y
v.out.ogr input='' output=''

Thanks for the help,
Dannick

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------
Changes (by robert17):

* Attachment "bug v.edit.png" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------
Changes (by robert17):

* Attachment "bug v.edit.png.zip" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------

Comment (by martinl):

Can you reproduce error on North Carolina dataset? If so please send exact
commands.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------

Comment (by jimmy):

Hello,

I think i have the same bug. Using grass 7.0.3 on MacOS, i created a
simple vector layer containing a simple line.
The projection system is EPSG:2154.
[http://i.imgur.com/xpIXaKf.png\]

I then tried to break it using this v.edit command:

{{{
v.edit --overwrite --verbose map=testeditbreak@Jimmy tool=break
threshold=0.1,0,0 ids=1
coords=3722.5895,-4456546.5289,3443.3747,-4456366.5145
}}}

Result in the command line ([http://i.imgur.com/wQupaCQ.png\])

Then [http://i.imgur.com/FoAACzn.png\] show the attribute table with 4
lines all of the same lenght.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------
Changes (by jimmy):

* Attachment "test_vedit_break_shp.zip" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------

Comment (by jimmy):

Hello,

Any ideas on this issues? Do you need more information?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.7
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------

Comment (by jradinger):

It seems that this issue is not yet solved?!

I just had similar problems using `v.edit tool=break`. Tested with version
7.4.1 (r72807M) and 7.5SVN (r73007M) and MacOS. Trying to break a line
vector map at multiple coordinates using `v.edit` causes that some of the
line features might not get broken (I don't know why). Then I can run
`v.edit tool=break` a second time which causes an overlay of the old line
feature with the two broken parts (so in sum three lines, that can be
identified using the gui query tool). This happens not for all
lines/coordinates; however I couldn't identify a common pattern that might
cause these errors.

Here an example with the NC dataset were I can at least reproduce the
error of getting mulitple overlayed lines when using the break tool (have
a look at the railroad line feature with the orig cat 3231):
{{{
from grass.script import core as grass

# Copy data from PERMANENT mapset
grass.run_command("g.copy",
     overwrite=True,
     vector="railroads@PERMANENT,railroads")
grass.run_command("v.extract",
     overwrite=True,
     input="firestations@PERMANENT",
     cat="58,66,29,35,31,32",
     output="firestations")

# Connectors to find exact break points coords
grass.run_command("v.distance",
     overwrite=True,
     to="railroads",
     from_="firestations",
     output="firestations_connectors")
firestations_connectors_coors = grass.read_command("v.to.db",
     flags="p",
     map="firestations_connectors",
     option="end",
     separator="comma").splitlines()
firestations_connectors_coors = [[",".join(x.split(",")[1:3])] for x in
firestations_connectors_coors[1:]]

# Break at point coords
grass.run_command("v.edit",
       tool="break",
       map="railroads",
       coords=firestations_connectors_coors,
       threshold=50,
       layer=1,
       cats="1-99999999")
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.7
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------
Changes (by jradinger):

* cc: jradinger (added)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#2903: v.edit break bug with multiple coordinates
-----------------------+-------------------------
  Reporter: robert17 | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.6.2
Component: Vector | Version: 7.0.3
Resolution: | Keywords:
       CPU: OSX/PPC | Platform: All
-----------------------+-------------------------
Changes (by martinl):

* milestone: 7.0.7 => 7.6.2

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2903#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>