Feature request #5713

Make analysis commands callable from Python

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

Status:Closed
Priority:Normal
Assignee:-
Category:C++ Plugins
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No

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

#1 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

#2 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.

#3 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?

#4 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

#5 Updated by Pirmin Kalberer over 4 years ago

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

#6 Updated by Giovanni Manghi 5 months ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed
  • 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 PDF