Skip to content
Permalink
Browse files

renamed "sextante" to "processing"

  • Loading branch information
volaya committed Aug 12, 2013
1 parent b429bcf commit 9bb3d6eb6b01321f33c30e66a8e48c0c94a61a98
Showing 1,480 changed files with 35,797 additions and 34,630 deletions.
@@ -0,0 +1,33 @@
SET (PROCESSING_PLUGIN_DIR ${QGIS_DATA_DIR}/python/plugins/processing)

ADD_SUBDIRECTORY(admintools)
ADD_SUBDIRECTORY(algs)
ADD_SUBDIRECTORY(commander)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(gdal)
ADD_SUBDIRECTORY(grass)
ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(images)
ADD_SUBDIRECTORY(lidar)
ADD_SUBDIRECTORY(modeler)
ADD_SUBDIRECTORY(otb)
ADD_SUBDIRECTORY(outputs)
ADD_SUBDIRECTORY(parameters)
ADD_SUBDIRECTORY(r)
ADD_SUBDIRECTORY(saga)
ADD_SUBDIRECTORY(script)
ADD_SUBDIRECTORY(taudem)
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(exampleprovider)

FILE(GLOB UI_FILES ui/*.ui)
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES})

FILE(GLOB OTHER_FILES metadata.txt)
FILE(GLOB PY_FILES *.py)

PYQT4_ADD_RESOURCES(PYRC_FILES resources.qrc)

PLUGIN_INSTALL(processing . ${PY_FILES} ${OTHER_FILES} ${PYRC_FILES})
PLUGIN_INSTALL(processing ui ${PYUI_FILES} ui/__init__.py)
@@ -0,0 +1,148 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
ProcessingPlugin.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

import shutil
import os, sys
import inspect
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from PyQt4 import QtGui
from processing.commander.CommanderWindow import CommanderWindow
from processing.core.Processing import Processing
from processing.core.QGisLayers import QGisLayers
from processing.core.ProcessingUtils import ProcessingUtils
from processing.gui.ProcessingToolbox import ProcessingToolbox
from processing.gui.HistoryDialog import HistoryDialog
from processing.gui.ConfigDialog import ConfigDialog
from processing.gui.ResultsDialog import ResultsDialog
from processing.modeler.ModelerDialog import ModelerDialog
import processing.resources_rc

cmd_folder = os.path.split(inspect.getfile( inspect.currentframe() ))[0]
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)

class ProcessingPlugin:

def __init__(self, iface):
self.iface = iface
QGisLayers.setInterface(iface)
Processing.initialize()
Processing.setInterface(iface)
Processing.setPlugin(self)

def initGui(self):
self.commander = None
self.toolbox = ProcessingToolbox(self.iface)
self.iface.addDockWidget(Qt.RightDockWidgetArea, self.toolbox)
self.toolbox.hide()
Processing.addAlgListListener(self.toolbox)

self.menu = QMenu(self.iface.mainWindow())
self.menu.setTitle(QCoreApplication.translate("Processing", "Processing"))

self.toolboxAction = self.toolbox.toggleViewAction()
self.toolboxAction.setIcon(QIcon(":/processing/images/alg.png"))
self.toolboxAction.setText(QCoreApplication.translate("Processing", "Toolbox"))
self.menu.addAction(self.toolboxAction)

self.modelerAction = QAction(QIcon(":/processing/images/model.png"),
QCoreApplication.translate("Processing", "Graphical modeler"),
self.iface.mainWindow())
self.modelerAction.triggered.connect(self.openModeler)
self.menu.addAction(self.modelerAction)

self.historyAction = QAction(QIcon(":/processing/images/history.gif"),
QCoreApplication.translate("Processing", "History and log"),
self.iface.mainWindow())
self.historyAction.triggered.connect(self.openHistory)
self.menu.addAction(self.historyAction)

self.configAction = QAction(QIcon(":/processing/images/config.png"),
QCoreApplication.translate("Processing", "Options and configuration"),
self.iface.mainWindow())
self.configAction.triggered.connect(self.openConfig)
self.menu.addAction(self.configAction)

self.resultsAction = QAction(QIcon(":/processing/images/results.png"),
QCoreApplication.translate("Processing", "&Results viewer"),
self.iface.mainWindow())
self.resultsAction.triggered.connect(self.openResults)
self.menu.addAction(self.resultsAction)

menuBar = self.iface.mainWindow().menuBar()
menuBar.insertMenu(self.iface.firstRightStandardMenu().menuAction(), self.menu)

self.commanderAction = QAction(QIcon(":/processing/images/commander.png"),
QCoreApplication.translate("Processing", "&Commander"),
self.iface.mainWindow())
self.commanderAction.triggered.connect(self.openCommander)
self.menu.addAction(self.commanderAction)
self.iface.registerMainWindowAction(self.commanderAction, "Ctrl+Alt+M")

def unload(self):
self.toolbox.setVisible(False)
self.menu.deleteLater()
#delete temporary output files
folder = ProcessingUtils.tempFolder()
if QDir(folder).exists():
shutil.rmtree(folder, True)

self.iface.unregisterMainWindowAction(self.commanderAction)

def openCommander(self):
if self.commander is None:
self.commander = CommanderWindow(self.iface.mainWindow(), self.iface.mapCanvas())
Processing.addAlgListListener(self.commander)
self.commander.prepareGui()
self.commander.show()
#dlg.exec_()


def openToolbox(self):
if self.toolbox.isVisible():
self.toolbox.hide()
else:
self.toolbox.show()

def openModeler(self):
dlg = ModelerDialog()
dlg.exec_()
if dlg.update:
self.toolbox.updateTree()

def openResults(self):
dlg = ResultsDialog()
dlg.exec_()

def openHistory(self):
dlg = HistoryDialog()
dlg.exec_()

def openConfig(self):
dlg = ConfigDialog(self.toolbox)
dlg.exec_()

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
__init__.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

from processing.tools.general import runalg, runandload, alghelp, alglist, algoptions, load, extent, getobject
from processing.tools.vector import getfeatures, spatialindex, values, uniquevalues
from processing.tools.raster import scanraster
from processing.tests.TestData import loadTestData

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

def classFactory(iface):
from processing.ProcessingPlugin import ProcessingPlugin
return ProcessingPlugin(iface)
@@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
AdminToolsAlgorithmProvider.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""
from processing.admintools.PostGISExecuteSQL import PostGISExecuteSQL
import os
from PyQt4 import QtGui

__author__ = 'Victor Olaya'
__date__ = 'October 2012'
__copyright__ = '(C) 2012, Victor Olaya'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

from processing.admintools.ImportIntoPostGIS import ImportIntoPostGIS
from processing.admintools.ImportVectorIntoGeoServer import ImportVectorIntoGeoServer
from processing.admintools.CreateWorkspace import CreateWorkspace
from processing.admintools.ImportRasterIntoGeoServer import ImportRasterIntoGeoServer
from processing.admintools.DeleteWorkspace import DeleteWorkspace
from processing.admintools.DeleteDatastore import DeleteDatastore
from processing.admintools.CreateStyleGeoServer import CreateStyleGeoServer
from processing.core.AlgorithmProvider import AlgorithmProvider

class AdminToolsAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.alglist = [ImportVectorIntoGeoServer(), ImportRasterIntoGeoServer(),
CreateWorkspace(), DeleteWorkspace(), DeleteDatastore(),
CreateStyleGeoServer()]

try:
self.alglist.append(ImportIntoPostGIS())
self.alglist.append(PostGISExecuteSQL())
except:
pass

def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)


def unload(self):
AlgorithmProvider.unload(self)


def getName(self):
return "gspg"

def getDescription(self):
return "GeoServer/PostGIS tools"

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/database.png")

def _loadAlgorithms(self):
self.algs = self.alglist

def supportsNonFileBasedOutput(self):
return False
@@ -0,0 +1,6 @@
FILE(GLOB PY_FILES *.py)

ADD_SUBDIRECTORY(geoserver)
ADD_SUBDIRECTORY(httplib2)

PLUGIN_INSTALL(processing ./admintools ${PY_FILES})
@@ -0,0 +1,61 @@
#===============================================================================
# # -*- coding: utf-8 -*-
#
# """
# ***************************************************************************
# CreateMosaicDatastore.py
# ---------------------
# Date : October 2012
# Copyright : (C) 2012 by Victor Olaya
# Email : volayaf at gmail dot com
# ***************************************************************************
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 2 of the License, or *
# * (at your option) any later version. *
# * *
# ***************************************************************************
# """
# from processing.core.LayerExporter import LayerExporter
# from processing.parameters.ParameterString import ParameterString
# from processing.servertools.GeoServerToolsAlgorithm import GeoServerToolsAlgorithm
#
# __author__ = 'Victor Olaya'
# __date__ = 'October 2012'
# __copyright__ = '(C) 2012, Victor Olaya'
# # This will get replaced with a git SHA1 when you do a git archive
# __revision__ = '$Format:%H$'
#
# from qgis.core import *
# from processing.parameters.ParameterVector import ParameterVector
# from processing.core.QGisLayers import QGisLayers
# import os
#
# class CreateMosaicDatastore(GeoServerToolsAlgorithm):
#
# INPUT = "INPUT"
# WORKSPACE = "WORKSPACE"
#
# def processAlgorithm(self, progress):
# self.createCatalog()
# input = self.getParameterValue(self.INPUT)
# workspaceName = self.getParameterValue(self.WORKSPACE)
# connection = {
# 'shp': basepathname + '.shp',
# 'shx': basepathname + '.shx',
# 'dbf': basepathname + '.dbf',
# 'prj': basepathname + '.prj'
# }
#
# workspace = self.catalog.get_workspace(workspaceName)
# self.catalog.create_featurestore(basefilename, connection, workspace)
#
#
# def defineCharacteristics(self):
# self.addcaddBaseParameters()
# self.name = "Import into GeoServer"
# self.group = "GeoServer management tools"
# self.addParameter(ParameterVector(self.INPUT, "Layer to import", [ParameterVector.VECTOR_TYPE_ANY]))
# self.addParameter(ParameterString(self.WORKSPACE, "Workspace"))
#===============================================================================

0 comments on commit 9bb3d6e

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