1

I recently updated to QGIS version 2.2, and am now getting an error when running Processing scripts that worked previously (in version 2.0.1).

Uncaught error while executing algorithm
Traceback (most recent call last):
Traceback (most recent call last):
File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py",    line 202, in execute
self.processAlgorithm(progress)
File "C:/PROGRA~1/QGISVA~1/apps/qgis/./python/plugins\processing\script\ScriptAlgorithm.py", line 252, in processAlgorithm
exec script in ns
File "<string>", line 25, in <module>
AttributeError: 'module' object has no attribute 'getobject'

I believe it's this line of code causing the error, but i'm not sure how to modify it to work with QGIS 2.2:

indivLayer = processing.getobject(Couche_compteurs_individuels)
2
  • What is the related code? For instance, what is processing and and .getobject()? getobject() isn't found in the API documentation, and I would expect it to be getObject() if it was a valid method.
    – midfield99
    Commented Apr 1, 2014 at 19:44
  • getobject(obj): Returns a QGIS object (a layer or table) from the passed object, which can be a filename or the name of the object in the QGIS Table of Contents. A command in the processing package: qgis.org/en/docs/user_manual/processing/…
    – user25976
    Commented Apr 1, 2014 at 19:51

1 Answer 1

2

The new version of processing use getObject instead of getobject:

 processing.getObject(Couche_compteurs_individuels) 

Look at How to terminate Python scripts in Processing framework properly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.