Trying to follow the suggestions on this thread: splitting a lines layer using points

However, how to do so in a windows environment using the GRASS command console is beyond me, so I'm attempting with the Python Console (still with no success).

used v.out.ascii module to create .txt of XY coordinates (xycoord.txt)

file = xycoord.txt
for x, y in file:
    grass.run_command('v.edit', map='reshydPART_Pirae', tool='break', coords='x,y')

ValueError: too many values to unpack

Does anyone have any suggestions? I wonder if it has to do with the ascii.output file I'm providing (there are newlines in my txt file). I'm feeling a little lost, especially regarding what to put for the coords parameter. I also can't tell what my error is due to. Thanks in advance.


GRASS GIS is not QGIS and it is not very difficult to find documentation:

  • v.edit: it for editing a GRASS vector map and not a QGIS vector map, so you don't need this command: it does not exist in the Processing Toolbox, nor in the GRASS Tools of the GRASS plugin.

  • v.edit in GRASS GIS:

enter image description here

  • v.distance: it is to find the nearest element in GRASS vector map 'to' for elements in GRASS vector map 'from' and the parameters are described on the web page.

  • v.distance in GRASS GIS:

enter image description here

  • you can use this command in the GRASS plugin but then you are working in GRASS GIS, with the vector layers present in a Location/Mapset of GRASS GIS, and and not those of QGIS (look at GRASS GIS Integration or QGIS GRASS Cookbook)

enter image description here

  • in the Processing Toolbox, this command has been adapted to work with the QGIS layers and the parameters are the same.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.