OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
852 stars 309 forks source link

[Bug] v.stream.order doesn't work on Grass 8 #4515

Open TheJoseph24 opened 1 month ago

TheJoseph24 commented 1 month ago

Describe the bug

Hi! I'm currently trying to assign the strahler order to a river basin. I already have the line feature. The lines are all connected and it seems there are no topology errors. I then created a point shapefile, using a processing tool in QGis, to indicate the direction of the flow. Every point is situated at the first vertex of each line, which is the exit point of the water. After importing the two files to a grass project, I select only the strahler order, leaving everything else at default, and run the tool. It alerts me to a bunch of duplicated edges (I don't know why) and then it gives me an error related with the start id. I'm new to python and Grass and I can't figure this out. Can someone tell me if there is something I'm missing? Thank you

Edit I´m going to drop a Mega link to all the files i´m working with. There you can find the waterlines and the exit points vector files, as well as the Grass Workspace: https://mega.nz/folder/Vg0TSYSI#Nvwm-iXkcj19hfh8kb07jA

(Mon Oct 14 16:16:55 2024)                                                      
v.stream.order input=Linhas_de_agua@PERMANENT points=Exutorios@PERMANENT output=order order=strahler
WARNING: Column name conflict: Renaming column <cat> from input map into cat_1 in output map
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
WARNING: Ignoring duplicated start edge
Traceback (most recent call last):
  File "C:\Users\unive\AppData\Roaming\GRASS8\addons/scripts
/v.stream.order.py", line 621, in <module>
    main()
  File "C:\Users\unive\AppData\Roaming\GRASS8\addons/scripts
/v.stream.order.py", line 614, in main
    detect_compute_networks(
  File "C:\Users\unive\AppData\Roaming\GRASS8\addons/scripts
/v.stream.order.py", line 576, in detect_compute_networks
    traverse_graph_create_stream_order(
  File "C:\Users\unive\AppData\Roaming\GRASS8\addons/scripts
/v.stream.order.py", line 178, in
traverse_graph_create_stream_order
    current_edge = edges[start_id]
                   ~~~~~^^^^^^^^^^
KeyError: 280
(Mon Oct 14 16:18:04 2024) Command ended with non-zero return code 1 (1 min 9 sec)
petrasovaa commented 1 month ago

It would help to have a reproducible example.

TheJoseph24 commented 1 month ago

It would help to have a reproducible example.

Hi, thank you for aswering. I´ve dropped a link to a folder with all the necessary files. I hope you can help me.