Commit
added first draft of geoserver tools nviz is back in grass tools
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
DatabaseToolProvider.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. * | ||
* * | ||
*************************************************************************** | ||
""" | ||
|
||
__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 sextante.core.AlgorithmProvider import AlgorithmProvider | ||
from PyQt4 import QtGui | ||
import os | ||
|
||
class DatabaseToolsAlgorithmProvider(AlgorithmProvider): | ||
|
||
def __init__(self): | ||
AlgorithmProvider.__init__(self) | ||
self.alglist = []#PostGISSQL(), ImportIntoPostGIS(), CreateTable()] | ||
|
||
def initializeSettings(self): | ||
AlgorithmProvider.initializeSettings(self) | ||
|
||
|
||
def unload(self): | ||
AlgorithmProvider.unload(self) | ||
|
||
|
||
def getName(self): | ||
return "database" | ||
|
||
def getDescription(self): | ||
return "Database tools" | ||
|
||
def getIcon(self): | ||
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/postgis.png") | ||
|
||
def _loadAlgorithms(self): | ||
self.algs = self.alglist | ||
|
||
def supportsNonFileBasedOutput(self): | ||
return True |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
__revision__ = '$Format:%H$' | ||
|
||
import os | ||
from sextante.core.SextanteUtils import SextanteUtils | ||
from sextante.core.SextanteUtils import mkdir | ||
from sextante.core.SextanteConfig import SextanteConfig | ||
|
||
|
@@ -37,8 +36,7 @@ class ModelerUtils: | |
def modelsFolder(): | ||
folder = SextanteConfig.getSetting(ModelerUtils.MODELS_FOLDER) | ||
if folder == None: | ||
#folder = os.path.join(os.path.dirname(__file__), "models") | ||
folder = SextanteUtils.userFolder() + os.sep + "models" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
volaya
Author
Contributor
|
||
folder = os.path.join(os.path.dirname(__file__), "models") | ||
mkdir(folder) | ||
|
||
return folder | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
NAME:Watersheds from DEM | ||
GROUP:[Sample models] | ||
PARAMETER:ParameterRaster|RASTERLAYER_DEM|DEM|False | ||
458.0,50.0 | ||
PARAMETER:ParameterNumber|NUMBER_INITIATIONTHRESHOLD|Initiation Threshold|None|None|10000000.0 | ||
257.0,403.0 | ||
VALUE:HARDCODEDPARAMVALUE_INIT_VALUE_1===10000000 | ||
VALUE:HARDCODEDPARAMVALUE_SPLIT_3===0 | ||
VALUE:HARDCODEDPARAMVALUE_Method_0===0 | ||
VALUE:HARDCODEDPARAMVALUE_INIT_METHOD_1===2 | ||
VALUE:HARDCODEDPARAMVALUE_CALC_METHOD_4===0 | ||
VALUE:HARDCODEDPARAMVALUE_CLASS_ID_3===0 | ||
VALUE:HARDCODEDPARAMVALUE_STEP_0===1 | ||
VALUE:HARDCODEDPARAMVALUE_MINLEN_1===10 | ||
VALUE:HARDCODEDPARAMVALUE_DOLINEAR _0===True | ||
VALUE:HARDCODEDPARAMVALUE_MINSIZE_2===0 | ||
VALUE:HARDCODEDPARAMVALUE_CLASS_ALL_3===1 | ||
VALUE:HARDCODEDPARAMVALUE_LINEARTHRS_0===500.0 | ||
VALUE:HARDCODEDPARAMVALUE_CONVERGENCE_0===1.0 | ||
VALUE:HARDCODEDPARAMVALUE_DIV_CELLS_1===10 | ||
ALGORITHM:saga:catchmentarea(parallel) | ||
260.0,172.0 | ||
-1|RASTERLAYER_DEM | ||
None | ||
None | ||
None | ||
None | ||
-1|HARDCODEDPARAMVALUE_STEP_0 | ||
-1|HARDCODEDPARAMVALUE_Method_0 | ||
-1|HARDCODEDPARAMVALUE_DOLINEAR _0 | ||
-1|HARDCODEDPARAMVALUE_LINEARTHRS_0 | ||
None | ||
None | ||
-1|HARDCODEDPARAMVALUE_CONVERGENCE_0 | ||
None | ||
None | ||
None | ||
None | ||
None | ||
None | ||
None | ||
None | ||
ALGORITHM:saga:channelnetwork | ||
447.0,291.0 | ||
-1|RASTERLAYER_DEM | ||
None | ||
0|CAREA | ||
-1|HARDCODEDPARAMVALUE_INIT_METHOD_1 | ||
-1|NUMBER_INITIATIONTHRESHOLD | ||
None | ||
-1|HARDCODEDPARAMVALUE_DIV_CELLS_1 | ||
None | ||
-1|HARDCODEDPARAMVALUE_MINLEN_1 | ||
None | ||
None | ||
None | ||
ALGORITHM:saga:watershedbasins | ||
730.0,182.0 | ||
-1|RASTERLAYER_DEM | ||
1|CHNLNTWRK | ||
None | ||
-1|HARDCODEDPARAMVALUE_MINSIZE_2 | ||
None | ||
ALGORITHM:saga:vectorisinggridclasses | ||
864.0,330.0 | ||
2|BASINS | ||
-1|HARDCODEDPARAMVALUE_CLASS_ALL_3 | ||
-1|HARDCODEDPARAMVALUE_CLASS_ID_3 | ||
-1|HARDCODEDPARAMVALUE_SPLIT_3 | ||
None | ||
ALGORITHM:ftools:export/addgeometrycolumns | ||
655.0,442.0 | ||
3|POLYGONS | ||
-1|HARDCODEDPARAMVALUE_CALC_METHOD_4 | ||
Watersheds |
7 comments
on commit 983535f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Victor,
Sextante seems broken to this revision !
Can you take a look at it, please ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Victor,
Don't know if it is related to this commit, but now getting the following on Sextante load, at launch of QGIS:
Couldn't load plugin sextante due an error when calling its classFactory() method
Traceback (most recent call last):
File "/Users/larrys/QGIS/github.com/build/output/python/qgis/utils.py", line 188, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/larrys/QGIS/github.com/build/output/python/plugins/sextante/__init__.py", line 45, in classFactory
from sextante.SextantePlugin import SextantePlugin
File "/Users/larrys/QGIS/github.com/build/output/python/qgis/utils.py", line 384, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/larrys/QGIS/github.com/build/output/python/plugins/sextante/SextantePlugin.py", line 34, in
from sextante.core.Sextante import Sextante
File "/Users/larrys/QGIS/github.com/build/output/python/qgis/utils.py", line 384, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/larrys/QGIS/github.com/build/output/python/plugins/sextante/core/Sextante.py", line 19, in
from sextante.servertools.GeoServerToolsAlgorithmProvider import GeoServerToolsAlgorithmProvider
File "/Users/larrys/QGIS/github.com/build/output/python/qgis/utils.py", line 384, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named servertools.GeoServerToolsAlgorithmProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work here !
Traceback (most recent call last):
File "/usr/local/share/qgis/python/qgis/utils.py", line 188, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/usr/local/share/qgis/python/plugins/sextante/init.py", line 45, in classFactory
from sextante.SextantePlugin import SextantePlugin
File "/usr/local/share/qgis/python/qgis/utils.py", line 384, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/local/share/qgis/python/plugins/sextante/SextantePlugin.py", line 34, in
from sextante.core.Sextante import Sextante
File "/usr/local/share/qgis/python/qgis/utils.py", line 384, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/local/share/qgis/python/plugins/sextante/core/Sextante.py", line 19, in
from sextante.servertools.GeoServerToolsAlgorithmProvider import GeoServerToolsAlgorithmProvider
File "/usr/local/share/qgis/python/qgis/utils.py", line 384, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named servertools.GeoServerToolsAlgorithmProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I fixed it. I forgot to add the folder to the cmakelists file, so it was not being built. Since I work with a 1.8 install and not with the git version, I could not see the problem (I have my own ant task to do the deploying). Now it should copy the new folder as well and everything should be fine :-)
Sorry for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and to get it to work ;-) , add CMakeLists.txt in dir servertools:
FILE(GLOB PY_FILES *.py) ADD_SUBDIRECTORY(geoserver) ADD_SUBDIRECTORY(httplib2) PLUGIN_INSTALL(sextante servertools ${PY_FILES})
in geoserver dir:
FILE(GLOB PY_FILES *.py) PLUGIN_INSTALL(sextante servertools/geoserver ${PY_FILES})
and finally httplib2 dir:
FILE(GLOB PY_FILES *.py) PLUGIN_INSTALL(sextante servertools/httplib2 ${PY_FILES})
this should solve the problem !
Thanks !
Hi Victor, you should revert this line in order to avoid permission error at least in unix system !