Bug report #17370

point parameter bug in processing batch process

Added by Patrick Palmier over 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:2.18.13 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25267

Description

Hello,
I'm writing script with processing tool.
When I used a point parameter the script works well, but when I run it as a batch process it scratches due to an error of point parameter.

Thanks

matrice.py Magnifier (1.34 KB) Patrick Palmier, 2017-11-02 01:40 PM

error_point_parameter_message.jpg (49.9 KB) Patrick Palmier, 2017-11-02 01:45 PM

zonage_EMD2016_GT_centroids.prj (432 Bytes) Patrick Palmier, 2017-11-02 01:49 PM

zonage_EMD2016_GT_centroids.dbf (11.5 KB) Patrick Palmier, 2017-11-02 01:49 PM

zonage_EMD2016_GT_centroids.qpj (683 Bytes) Patrick Palmier, 2017-11-02 01:49 PM

zonage_EMD2016_GT_centroids.shp (15.3 KB) Patrick Palmier, 2017-11-02 01:49 PM

zonage_EMD2016_GT_centroids.shx (4.45 KB) Patrick Palmier, 2017-11-02 01:49 PM

script_parameters.jpg (77.9 KB) Patrick Palmier, 2017-11-02 02:39 PM

History

#1 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Open to Feedback

Please add the script, the data and the error message.

#2 Updated by Patrick Palmier over 6 years ago

Hello,

To reproduce the bug run the script matrice.py as batch process (in normal mode it works. It crashes only in batch process mode)

Fill with
noeuds: zonage_EMD2016_GT_centroids (attached)
numero: zone
pt_depart: click on the map near a point object
pt_arrivee: click on the map near a point object
nb_passagers: 1
jour: 1
heure: 8:00:00
depart: Yes

Then, run the script. It should crash and show a message similar to error_point_parameter_message.jpg

Thanks

#3 Updated by Giovanni Manghi over 6 years ago

Just tried on 2.18.14 on both Linux and Windows and (not in batch mode) running the tool (with the parameters as you described) does nothing: no output, no error message, nothing also in qgis log.

#4 Updated by Patrick Palmier over 6 years ago

Hello,

I just installed the 2.18.14 version and I still have the same error
Please find the filled parameters screenshot
My version of the processing extension is 2.12.99

2017-11-02T14:34:50 1 Traceback (most recent call last):
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\gui\BatchAlgorithmDialog.py", line 78, in accept
if not self.mainWidget.setParamValue(param, widget, alg):
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\gui\BatchPanel.py", line 320, in setParamValue
return param.setValue(widget.text())
AttributeError: 'PointSelectionPanel' object has no attribute 'text'

#5 Updated by Giovanni Manghi over 6 years ago

2017-11-02T14:34:50 1 Traceback (most recent call last):
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\gui\BatchAlgorithmDialog.py", line 78, in accept
if not self.mainWidget.setParamValue(param, widget, alg):
File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\gui\BatchPanel.py", line 320, in setParamValue
return param.setValue(widget.text())
AttributeError: 'PointSelectionPanel' object has no attribute 'text'

I see this, but this is anyway a different error from the one you posted as an image. And anyway not using the batch mode the scripts does nothing (again tested on linux and windows).

#6 Updated by Patrick Palmier over 6 years ago

If you don't use it in batch mode but in normal mode and if you set a output text file (fichier_matrice), the script will write a semicolon delimited file with one row containing as the disk location you choose.

the zone number of the nearest point from the first click
the zone number of the nearest point from the second click
the number of passengers (form value nb_passengers)
the day (form value of jour)
the time in minutes (conversion in minutes of the from value heure)
d if depart is checked (a if not)

It's not awesome but yes, the script does something (It's just a small example to show the bug)

#7 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Feedback to Open

Patrick Palmier wrote:

If you don't use it in batch mode but in normal mode and if you set a output text file (fichier_matrice), the script will write a semicolon delimited file with one row containing as the disk location you choose.

oh I see... I was expecting something to be loaded in the project.

#8 Updated by Nyall Dawson almost 6 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

Fixed in 3.0

Also available in: Atom PDF