Feature request #5713

Make analysis commands callable from Python

Added by Paolo Cavallini almost 5 years ago. Updated 3 months ago.

Status:Closed Start Date:06/02/2012
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:C++ Plugins
Target version:Future Release - Nice to have
Platform: Resolution:fixed/implemented
Platform version: Pull Request or Patch supplied:No
Status info: Tag:

Description

This would allow them to be used from other applications, and more importantly from SEXTANTE, so they can be included in models, scripts etc.

History

Updated by Alexander Bruy almost 5 years ago

Zonal statistics, network analysis and most geoproccessing functions already have Python bindings and can be used from plugins

Updated by Nathan Woodrow almost 5 years ago

I'm not really sure that it is needed IMO as you can just use python and import qgis and use them like that.

As SEXTANTE is part of QGIS via the plugin system it can already use anything that is exposed to Python, which includes qgis.analysis. If SEXTANTE was ported to core (once stable) it will be able to use stuff that isn't exposed to Python.

Adding command line options for use with SEXTANTE doesn't make much sense as you would need to create a new instance of QGIS, do work, then close.

Updated by Paolo Cavallini almost 5 years ago

  • Subject changed from Make analysis commands callable from CLI to Make analysis commands callable from Python

All methods should be therefore exposed through Python to be usable this way. Where can we find documentation on how to call these functions?

Updated by Alexander Bruy almost 5 years ago

Paolo Cavallini wrote:

All methods should be therefore exposed through Python to be usable this way. Where can we find documentation on how to call these functions?

Some information can be found in API docs http://qgis.org/api/group__analysis.html, http://qgis.org/api/classQgsZonalStatistics.html and http://qgis.org/api/group__networkanalysis.html. For network analysis there is also description and examples in CookBook http://www.qgis.org/pyqgis-cookbook/network-analysis.html

Updated by Pirmin Kalberer over 4 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

Updated by Giovanni Manghi 3 months ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented
  • road graph
  • interpolation
  • terrain analysis
  • zonalstatistics
  • heatmap

are now part of the analysis library (and the respective tools ported to Processing).

Also available in: Atom