Bug report #16672

v.net.alloc in Processing

Added by Pedro Venâncio about 4 years ago. Updated about 4 years ago.

Assignee:Alexander Bruy
Affected QGIS version:2.18.9 Regression?:No
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:24571


I was trying to use v.net.alloc in QGIS Processing, to find the closest (time/distance) fire stations.

I've a points layer and a lines layer (open street map shapefile, from Geofabrik) with costs (distance / time) in both and backward directions, but v.net.alloc was giving no result.

Then I've tested with GRASS sample data (nc_spm_08 [0]), to be sure that was not a data problem, and again, I get no result.

So I found that it needs to overwrite the output in v.out.ogr.

Adding the --overwrite flag to line 95 of v_net.py file [1], like

command = u"v.out.ogr {} type={} layer={} -s -e input={} output=\"{}\" format=ESRI_Shapefile output_layer={} --overwrite".format(

makes v.net.alloc to work on QGIS Processing.

I've done some tests, and everything seems to work ok with the overwrite flag, but I prefer to ask if this would be the best solution.

Can someone please test? Here are two layers of GRASS sample dataset, exported to shapefile, that can be used:


[0] https://grass.osgeo.org/download/sample-data/

[1] https://github.com/qgis/QGIS/blob/release-2_18/python/plugins/processing/algs/grass7/ext/v_net.py#L95

Associated revisions

Revision 68965485
Added by Alexander Bruy about 4 years ago

Merge pull request #4705 from PedroVenancio/master

[processing] fixes GRASS 7 v.net.alloc (fix #16672)

Revision e5b28434
Added by Alexander Bruy about 4 years ago

Merge pull request #4710 from PedroVenancio/fix_16672_2_18

[processing] fixes GRASS 7 v.net.alloc (fix #16672)


#1 Updated by Giovanni Manghi about 4 years ago

  • Status changed from Open to Feedback

If it is right for the v.net modules than I would say go for it.

#2 Updated by Pedro Venâncio about 4 years ago

I've tested the following v.net modules after this change, and work well:
- v.net.distance
- v.net.iso
- v.net.allpairs
- v.net.alloc
- v.net.salesman

#3 Updated by Alexander Bruy about 4 years ago

  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

Also available in: Atom PDF