anitagraser / QGIS-Processing-tools

This is a collection of scripts and models for QGIS Processing
89 stars 55 forks source link

In QGIS 2.6 script is not working #3

Closed gimoya closed 9 years ago

gimoya commented 9 years ago

With 2.6 the script runs without error but returns empty result...

brylie commented 9 years ago

@gimoya which script are you running?

anitagraser commented 9 years ago

http://gis.stackexchange.com/questions/122414/qgis-python-script-routing-along-waypoints/122434#122434

works for me. reopen if necessary.

slarosa commented 9 years ago

Hi @anitagraser, I never tried this script, today was my first time and I found useful it but with latest processing version (2.6 and master) I am getting the following error:

Traceback (most recent call last):
  File "/usr/local/share/qgis/python/plugins/processing/core/GeoAlgorithm.py", line 212, in execute
    self.processAlgorithm(progress)
  File "/usr/local/share/qgis/python/plugins/processing/script/ScriptAlgorithm.py", line 264, in processAlgorithm
    exec(script) in ns
  File "<string>", line 18, in <module>
  File "/usr/local/share/qgis/python/qgis/utils.py", line 460, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named VectorWriter

The workaround I posted here has worked for me. I tried with the testdata.sqlite sample data by using routepoints1 and network as imput layers. While if I downgrade the processing plugin (to 2.2.0-2) the current version of the script works fine.

I am on Linux but I guess it should not be different from Windows...

anitagraser commented 9 years ago

Ok, I can reproduce the issue on Ubuntu ...

anitagraser commented 9 years ago

There is a new folder for processing 2.6 scripts: https://github.com/anitagraser/QGIS-Processing-tools/tree/master/2.6/scripts

Please feel free to help with migrating the scripts, e.g. by fixing the import to

from processing.tools.vector import VectorWriter

brylie commented 9 years ago

I would like to help with this issue. I can post my results on the Github issue queue. Generally, what steps would I follow on each script to test it with QGIS 2.6?

anitagraser commented 9 years ago

Thanks for offering your help! The general idea would be: get the script and try to run it in Processing 2.6. Then fix the failing imports. (So far, I haven't found any other things that need fixing.) Then create a pull request for the version 2.6 script

brylie commented 9 years ago

I have created a pull request(#9) with my changes.

anitagraser commented 9 years ago

should be fixed.