Skip to content
Permalink
Browse files

updated help

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@246 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
volayaf@gmail.com
volayaf@gmail.com committed Jun 15, 2012
1 parent cfab06e commit a36a2a99df866ff005e6b90f01a4540efea9eba8
@@ -9,9 +9,15 @@ class AlgorithmProvider():
'''

def __init__(self):
#indicates if the provider should be active by default.
#For provider relying on an external software, this should be
#false, so the user should activate them manually and install
#the required software in advance.
self.activate = True
self.actions = []
self.contextMenuActions = []


def loadAlgorithms(self):
self.algs = []
name = "ACTIVATE_" + self.getName().upper().replace(" ", "_")
@@ -36,7 +42,7 @@ def initializeSettings(self):
By default it just adds a setting to activate or deactivate algorithms from the provider'''
SextanteConfig.settingIcons[self.getDescription()] = self.getIcon()
name = "ACTIVATE_" + self.getName().upper().replace(" ", "_")
SextanteConfig.addSetting(Setting(self.getDescription(), name, "Activate", True))
SextanteConfig.addSetting(Setting(self.getDescription(), name, "Activate", self.activate))

def unload(self):
'''Do here anything that you want to be done when the provider is removed from the list of available ones.
@@ -17,10 +17,7 @@
from sextante.modeler.ModelerOnlyAlgorithmProvider import ModelerOnlyAlgorithmProvider
from sextante.gdal.GdalAlgorithmProvider import GdalAlgorithmProvider
from sextante.otb.OTBAlgorithmProvider import OTBAlgorithmProvider
from sextante.lastools.LasToolsAlgorithmProvider import LasToolsAlgorithmProvider
from sextante.core.SextanteUtils import SextanteUtils
from sextante.algs.SextanteAlgorithmProvider import SextanteAlgorithmProvider
from sextante.fusion.FusionAlgorithmProvider import FusionAlgorithmProvider
from sextante.pymorph.PymorphAlgorithmProvider import PymorphAlgorithmProvider
from sextante.mmqgisx.MMQGISXAlgorithmProvider import MMQGISXAlgorithmProvider
from sextante.lidar.LidarToolsAlgorithmProvider import LidarToolsAlgorithmProvider

This file was deleted.

@@ -2,9 +2,6 @@
from PyQt4.QtGui import *
from PyQt4 import QtCore, QtGui
from sextante.core.SextanteConfig import SextanteConfig
from sextante.core.Sextante import Sextante
from sextante.core.SextanteUtils import SextanteUtils
from sextante.gui.ExternalAppsConfigurer import ExternalAppsConfigurer


class ConfigDialog(QtGui.QDialog):
@@ -41,13 +38,6 @@ def setupUi(self):
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
#=======================================================================
# if SextanteUtils.isWindows():
# self.externalAppsButton = QtGui.QPushButton()
# self.externalAppsButton.setText("Configure external apps")
# self.horizontalLayout.addWidget(self.externalAppsButton)
# QtCore.QObject.connect(self.externalAppsButton, QtCore.SIGNAL("clicked()"), self.configureExternalApps)
#=======================================================================
self.horizontalLayout.addSpacing(100)
self.horizontalLayout.addWidget(self.buttonBox)
self.verticalLayout.addLayout(self.horizontalLayout)
@@ -56,10 +46,6 @@ def setupUi(self):
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.cancelPressed)
QtCore.QMetaObject.connectSlotsByName(self)

def configureExternalApps(self):
configurer = ExternalAppsConfigurer()
configurer.configure()


def fillTree(self):
self.items = {}

This file was deleted.

This file was deleted.

This file was deleted.

@@ -9,6 +9,9 @@
from sextante.core.SextanteLog import SextanteLog
from sextante.core.SextanteConfig import SextanteConfig
from sextante.core.QGisLayers import QGisLayers
import os
import sys
import subprocess

try:
_fromUtf8 = QtCore.QString.fromUtf8
@@ -37,6 +40,10 @@ def setupUi(self):
self.verticalLayout = QtGui.QVBoxLayout(self.contents)
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.externalAppsButton = QtGui.QPushButton()
self.externalAppsButton.setText("Click here to configure additional algorithm providers")
QObject.connect(self.externalAppsButton, QtCore.SIGNAL("clicked()"), self.configureProviders)
self.verticalLayout.addWidget(self.externalAppsButton)
self.searchBox = QtGui.QLineEdit(self.contents)
self.searchBox.textChanged.connect(self.fillTree)
self.verticalLayout.addWidget(self.searchBox)
@@ -52,6 +59,15 @@ def setupUi(self):
self.iface.addDockWidget(Qt.RightDockWidgetArea, self)
QtCore.QMetaObject.connectSlotsByName(self)

def configureProviders(self):
filename = os.path.join(os.path.dirname(__file__), "..", "help", "3rdParty.html")
if os.name == "nt":
os.startfile(filename)
elif sys.platform == "darwin":
subprocess.Popen(('open', filename))
else:
subprocess.call(('xdg-open', filename))

def showPopupMenu(self,point):
item = self.algorithmTree.itemAt(point)
if isinstance(item, TreeAlgorithmItem):
@@ -141,18 +157,20 @@ def fillTree(self):
groups[alg.group] = groupItem
algItem = TreeAlgorithmItem(alg)
groupItem.addChild(algItem)
#add actions
actions = Sextante.actions[providerName]
for action in actions:
if text =="" or text.lower() in action.name.lower():
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QtGui.QTreeWidgetItem()
groupItem.setText(0,action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)

#add actions only if there are algorithms in this provider
if len(groups)>0:
actions = Sextante.actions[providerName]
for action in actions:
if text =="" or text.lower() in action.name.lower():
if action.group in groups:
groupItem = groups[action.group]
else:
groupItem = QtGui.QTreeWidgetItem()
groupItem.setText(0,action.group)
groups[action.group] = groupItem
algItem = TreeActionItem(action)
groupItem.addChild(algItem)

if len(groups)>0:
providerItem = QtGui.QTreeWidgetItem()
@@ -52,16 +52,18 @@ <h1>Configuring external applications<a class="headerlink" href="#configuring-ex
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>SEXTANTE can be extended using additional applications, calling them
from within SEXTANTE. Currently, SAGA, GRASS, OTB(Orfeo Toolbox) and R are supported, along
with some other command-line applications that provide spatial data
analysis functionalities.
This chapter will show you how to configure SEXTANTE to include these
from within SEXTANTE.</p>
<p>By default, algorithms coming from external applications are not activated unless SEXTANTE has checked that the corresponding applications are installed in your system and can be executed. That means that there are probably many more algorithms available than those that you can see in the toolbox, but some extra configuration is needed to have them fully operational.</p>
<p>This chapter will show you how to configure SEXTANTE to include these
additional applications. Once you have correctly configured the system,
you will be able to execute external algorithms from any SEXTANTE
component like the toolbox or the graphical modeler, just like you do
with any other SEXTANTE geoalgorithm.</p>
<p>At the time of writing this manual, SEXTANTE has two external providers activated by default: GRASS and GDAL. This providers are activated because QGIS includes both the GRASS binaries and the GDAL library files, so there is no need for further configuration (QGIS developers have done that in advance for you). This might change in other versions, but for now it means that you need to manually install and configure those external programs. Do not worry, this is very easy to do. If you are running Linux, you just have to install the software yourself and then activate the corresponding algorithm provider. If you are running Windows, you should also tell SEXTANTE the path to the software.</p>
<p>For each algorithm provider there is a group entry in the SEXTANTE configuration dialog, which contains at least an &#8220;Activate&#8221; item. Other parameters might appear if they are needed to configure the provider (mostly paths to executales and additional files). In the following sections, we will see how to set those parameters for the main providers currently available for SEXTANTE. But first, a couple of quick notes with important information about using algorithms based on external applications.</p>
<div class="section" id="a-note-on-file-formats">
<h3>A note on file formats<a class="headerlink" href="#a-note-on-file-formats" title="Permalink to this headline"></a></h3>
<p>Algorithms provided by external applications have some differences when compared to &#8220;native&#8221; SEXTANTE algorithm. The main one of them is related to the file formats supported both for input and for output.</p>
<p>When using an external software, opening a file in QGIS does not mean
that it can be opened and processed as well on that other software. In
most cases, it can read what you have opened in QGIS, but in some cases,
@@ -114,7 +116,7 @@ <h3>A note on vector layer selections<a class="headerlink" href="#a-note-on-vect
<h2>SAGA<a class="headerlink" href="#saga" title="Permalink to this headline"></a></h2>
<p>SAGA algorithms can be run from SEXTANTE if you have SAGA installed in
your system and you configure SEXTANTE properly so it can find SAGA
executables. In particular, the SAGA commandline executable is needed
executables. In particular, the SAGA command-line executable is needed
to run SAGA algorithms. SAGA binaries are not included with SEXTANTE, so
you have to download and install the software yourself. Please check the
SAGA website at for more information. SAGA 2.0.8 is needed.</p>
@@ -187,7 +189,7 @@ <h2>R. Creating R scripts<a class="headerlink" href="#r-creating-r-scripts" titl
the syntax to use to call those R commands from SEXTANTE and how to use
SEXTANTE objects (layers, tables) in them.</p>
<p>The first thing you have to do, as we saw in the case of SAGA, is to
tell SEXTANTE where you R binaries are located. You can do so using the
tell SEXTANTE where your R binaries are located. You can do so using the
<em>R folder</em> entry in the SEXTANTE configuration dialog. Once you have set
that parameter, you can start creating your own R scripts and executing
them.</p>
@@ -265,8 +267,9 @@ <h2>R. Creating R scripts<a class="headerlink" href="#r-creating-r-scripts" titl
console instead, you have to tell SEXTANTE that you want the console to
be shown once the execution is finished. To do so, just start the
command lines that produce the results you want to print with the
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow><mo>&gt;</mo></mrow></math>” sign. The output of all other lines will not be shown. For
<span class="math">
\(&gt;\)</span>
” sign. The output of all other lines will not be shown. For
instance, here is the description file of an algorithms that performs a
normality test on a given field (column) of the attributes of a vector
layer:</p>

0 comments on commit a36a2a9

Please sign in to comment.
You can’t perform that action at this time.