Bug report #16672

v.net.alloc in Processing

Added by Pedro Venâncio over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:High
Assignee:Alexander Bruy
Category:Processing/GRASS
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

Description

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:

https://cld.pt/dl/download/c7cb667b-92ae-4760-8e43-79ae95550dcd/grass_nc_spm_08_sample_data.zip

[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 over 3 years ago

Merge pull request #4705 from PedroVenancio/master

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

Revision e5b28434
Added by Alexander Bruy over 3 years ago

Merge pull request #4710 from PedroVenancio/fix_16672_2_18

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

History

#1 Updated by Giovanni Manghi over 3 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 over 3 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 over 3 years ago

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

Also available in: Atom PDF