Skip to content
Permalink
Browse files

fixed problems with missing example scripts folder

Restructured gdal tools (now gdal/ogr)
Added new OTB segmentation algos
  • Loading branch information
volaya committed Nov 9, 2012
1 parent b965254 commit 27f197cf242416ce3aa6a2e71ec9fe5dbf8e5378
Showing with 2,778 additions and 127 deletions.
  1. +181 −0 python/plugins/sextante/add_OTB_segmentation_algs.patch
  2. +2 −1 python/plugins/sextante/admintools/AdminToolsAlgorithmProvider.py
  3. +1 −1 python/plugins/sextante/admintools/CMakeLists.txt
  4. +57 −0 python/plugins/sextante/admintools/ImportIntoPostGIS.py
  5. +9 −10 python/plugins/sextante/admintools/PostGISExecuteSQL.py
  6. +1 −1 python/plugins/sextante/admintools/geoserver/CMakeLists.txt
  7. +1 −1 python/plugins/sextante/admintools/httplib2/CMakeLists.txt
  8. +0 −74 python/plugins/sextante/algs/SextanteVectorWriter.py
  9. +2 −3 python/plugins/sextante/core/Sextante.py
  10. +4 −0 python/plugins/sextante/core/SextanteVectorWriter.py
  11. +1 −0 python/plugins/sextante/gdal/CMakeLists.txt
  12. +13 −4 python/plugins/sextante/gdal/{GdalAlgorithmProvider.py → GdalOgrAlgorithmProvider.py}
  13. +47 −0 python/plugins/sextante/gdal/OgrAlgorithm.py
  14. +59 −0 python/plugins/sextante/gdal/gdaladdo.py
  15. +2 −2 python/plugins/sextante/gdal/information.py
  16. +2 −2 python/plugins/sextante/gdal/merge.py
  17. +2 −2 python/plugins/sextante/gdal/nearblack.py
  18. +163 −0 python/plugins/sextante/gdal/ogr2ogr.py
  19. +132 −0 python/plugins/sextante/gdal/ogrinfo.py
  20. +93 −0 python/plugins/sextante/gdal/ogrsql.py
  21. +1 −1 python/plugins/sextante/gdal/pct2rgb.py
  22. +2 −2 python/plugins/sextante/gdal/polygonize.py
  23. +3 −0 python/plugins/sextante/gdal/pyogr/CMakeLists.txt
  24. 0 python/plugins/sextante/{script/scripts/dummy.txt → gdal/pyogr/__init__.py}
  25. +1,580 −0 python/plugins/sextante/gdal/pyogr/ogr2ogr.py
  26. +44 −0 python/plugins/sextante/gdal/pyogr/ogrds.py
  27. +153 −0 python/plugins/sextante/gdal/pyogr/ogrvrt.py
  28. +1 −1 python/plugins/sextante/gdal/rgb2pct.py
  29. +1 −1 python/plugins/sextante/gdal/scripts/fillnodata.py
  30. +1 −1 python/plugins/sextante/gdal/scripts/proximity.py
  31. +1 −1 python/plugins/sextante/gdal/scripts/sieve.py
  32. +2 −2 python/plugins/sextante/gdal/translate.py
  33. +2 −2 python/plugins/sextante/gdal/warp.py
  34. +6 −0 python/plugins/sextante/grass/GrassAlgorithmProvider.py
  35. +27 −0 python/plugins/sextante/gui/BatchProcessingDialog.py
  36. +2 −0 python/plugins/sextante/modeler/CMakeLists.txt
  37. +2 −0 python/plugins/sextante/modeler/ModelerAlgorithmProvider.py
  38. +2 −1 python/plugins/sextante/modeler/ModelerDialog.py
  39. +4 −0 python/plugins/sextante/modeler/ModelerParameterDefinitionDialog.py
  40. +1 −0 python/plugins/sextante/modeler/ModelerParametersDialog.py
  41. +11 −0 python/plugins/sextante/otb/description/EdisonMeanShiftSegmentation.txt
  42. +21 −0 python/plugins/sextante/otb/description/EdisonMeanShiftSegmentation_vector.txt
  43. +10 −11 python/plugins/sextante/otb/description/MeanShiftSegmentation.txt
  44. +22 −0 python/plugins/sextante/otb/description/MeanShiftSegmentation_vector.txt
  45. +8 −0 python/plugins/sextante/otb/description/SimpleConnectedComponentsSegmentation.txt
  46. +18 −0 python/plugins/sextante/otb/description/SimpleConnectedComponentsSegmentation_vector.txt
  47. +9 −0 python/plugins/sextante/otb/description/WatershedSegmentation.txt
  48. +19 −0 python/plugins/sextante/otb/description/WatershedSegmentation_vector.txt
  49. +2 −0 python/plugins/sextante/r/RAlgorithmProvider.py
  50. +6 −0 python/plugins/sextante/saga/SagaAlgorithmProvider.py
  51. +3 −1 python/plugins/sextante/script/CMakeLists.txt
  52. +3 −1 python/plugins/sextante/script/ScriptAlgorithm.py
  53. +3 −1 python/plugins/sextante/script/ScriptAlgorithmProvider.py
  54. +36 −0 python/plugins/sextante/script/scripts/Save_selected_features.py
@@ -0,0 +1,181 @@
diff --git a/otb/description/EdisonMeanShiftSegmentation.txt b/otb/description/EdisonMeanShiftSegmentation.txt
new file mode 100644
index 0000000..8fa331c
--- /dev/null
+++ b/otb/description/EdisonMeanShiftSegmentation.txt
@@ -0,0 +1,11 @@
+EdisonMeanShiftSegmentation
+otbcli_Segmentation
+Edison Mean Shift segmentation (labeled raster output)
+Segmentation
+ParameterRaster|-filter edison -in|Input Image|False
+ParameterNumber|-filter.edison.spatialr|Spatial radius|None|None|5
+ParameterNumber|-filter.edison.ranger|Range radius|None|None|15.0
+ParameterNumber|-filter.edison.minsize|Min region size|0|None|100
+ParameterNumber|-filter.edison.scale|Scale Factor|0|None|1.0
+OutputRaster|-mode raster -mode.raster.out|Output labeled image
+
diff --git a/otb/description/EdisonMeanShiftSegmentation_vector.txt b/otb/description/EdisonMeanShiftSegmentation_vector.txt
new file mode 100644
index 0000000..462c288
--- /dev/null
+++ b/otb/description/EdisonMeanShiftSegmentation_vector.txt
@@ -0,0 +1,21 @@
+EdisonMeanShiftSegmentationVector
+otbcli_Segmentation
+Edison Mean Shift segmentation (large-scale, vector output)
+Segmentation
+ParameterRaster|-filter edison -in|Input Image|False
+ParameterNumber|-filter.edison.spatialr|Spatial radius|None|None|5
+ParameterNumber|-filter.edison.ranger|Range radius|None|None|15.0
+ParameterNumber|-filter.edison.minsize|Min region size|0|None|100
+ParameterNumber|-filter.edison.scale|Scale Factor|0|None|1.0
+OutputVector|-mode vector -mode.vector.out|Output vector file
+ParameterVector|-mode.vector.inmask|Mask Image|-1|True
+ParameterBoolean|-mode.vector.neighbor|8-neighbor connectivity|False
+ParameterBoolean|-mode.vector.stitch|Stitch polygons|True
+ParameterNumber|-mode.vector.minsize|Minimum object size|1|None|1
+ParameterNumber|-mode.vector.simplify|Simplify polygons|None|None|0.0
+ParameterString|-mode.vector.layername|Layer name |layer
+ParemeterString|-mode.vector.fieldname|Geometry index field name|DN
+ParameterNumber|-mode.vector.tilesize|Tile size|0|None|1024
+ParameterNumber|-mode.vector.startlabel|Starting geometry index|1|None|1
+ParameterSelection|-mode.vector.outmode|Writing mode (update file/overwrite file/overwrite layer/update layer)|ulco;ovw;ulovw;ulu|0
+ParameterString|-mode.vector.ogroptions|OGR options for layer creation|
\ No newline at end of file
diff --git a/otb/description/MeanShiftSegmentation.txt b/otb/description/MeanShiftSegmentation.txt
index 333299e..a8ad1cd 100644
--- a/otb/description/MeanShiftSegmentation.txt
+++ b/otb/description/MeanShiftSegmentation.txt
@@ -1,13 +1,12 @@
MeanShiftSegmentation
-otbcli_MeanShiftSegmentation
-Mean Shift segmentation
+otbcli_Segmentation
+Mean Shift segmentation (labeled raster output)
Segmentation
-ParameterRaster|-in|Input Image|False
-OutputRaster|-fout|Filtered output
-OutputRaster|-cout|Clustered output
-OutputRaster|-lout|Label output
-OutputRaster|-cbout|Cluster Boundaries output
-ParameterNumber|-spatialr|Spatial radius|None|None|5
-ParameterNumber|-ranger|Range radius|None|None|15.0
-ParameterNumber|-minsize|Min region size|None|None|100
-ParameterNumber|-scale|Scale|None|None|100000.0
+ParameterRaster|-filter meanshift -in|Input Image|False
+ParameterNumber|-filter.meanshift.spatialr|Spatial radius|None|None|5
+ParameterNumber|-filter.meanshift.thres|Mode convergence threshold|None|None|0.1
+ParameterNumber|-filter.meanshift.ranger|Range radius|None|None|15.0
+ParameterNumber|-filter.meanshift.minsize|Min region size|0|None|100
+ParameterNumber|-filter.meanshift.maxiter|Maximum number of iterations|0|None|100
+OutputRaster|-mode raster -mode.raster.out|Output labeled image
+
diff --git a/otb/description/MeanShiftSegmentation_vector.txt b/otb/description/MeanShiftSegmentation_vector.txt
new file mode 100644
index 0000000..0798c1a
--- /dev/null
+++ b/otb/description/MeanShiftSegmentation_vector.txt
@@ -0,0 +1,22 @@
+MeanShiftSegmentationVector
+otbcli_Segmentation
+Mean Shift segmentation (large-scale, vector output)
+Segmentation
+ParameterRaster|-filter meanshift -in|Input Image|False
+ParameterNumber|-filter.meanshift.spatialr|Spatial radius|None|None|5
+ParameterNumber|-filter.meanshift.thres|Mode convergence threshold|None|None|0.1
+ParameterNumber|-filter.meanshift.ranger|Range radius|None|None|15.0
+ParameterNumber|-filter.meanshift.minsize|Min region size|0|None|100
+ParameterNumber|-filter.meanshift.maxiter|Maximum number of iterations|0|None|100
+OutputVector|-mode vector -mode.vector.out|Output vector file
+ParameterVector|-mode.vector.inmask|Mask Image|-1|True
+ParameterBoolean|-mode.vector.neighbor|8-neighbor connectivity|False
+ParameterBoolean|-mode.vector.stitch|Stitch polygons|True
+ParameterNumber|-mode.vector.minsize|Minimum object size|1|None|1
+ParameterNumber|-mode.vector.simplify|Simplify polygons|None|None|0.0
+ParameterString|-mode.vector.layername|Layer name |layer
+ParemeterString|-mode.vector.fieldname|Geometry index field name|DN
+ParameterNumber|-mode.vector.tilesize|Tile size|0|None|1024
+ParameterNumber|-mode.vector.startlabel|Starting geometry index|1|None|1
+ParameterSelection|-mode.vector.outmode|Writing mode (update file/overwrite file/overwrite layer/update layer)|ulco;ovw;ulovw;ulu|0
+ParameterString|-mode.vector.ogroptions|OGR options for layer creation|
\ No newline at end of file
diff --git a/otb/description/SimpleConnectedComponentsSegmentation.txt b/otb/description/SimpleConnectedComponentsSegmentation.txt
new file mode 100644
index 0000000..73c0ad2
--- /dev/null
+++ b/otb/description/SimpleConnectedComponentsSegmentation.txt
@@ -0,0 +1,8 @@
+SimpleConnectedComponentsSegmentation
+otbcli_Segmentation
+Simple Connected Components segmentation (labeled raster output)
+Segmentation
+ParameterRaster|-filter cc -in|Input Image|False
+ParameterString|-filter.cc.expr|Condition|
+OutputRaster|-mode raster -mode.raster.out|Output labeled image
+
diff --git a/otb/description/SimpleConnectedComponentsSegmentation_vector.txt b/otb/description/SimpleConnectedComponentsSegmentation_vector.txt
new file mode 100644
index 0000000..77ec4b5
--- /dev/null
+++ b/otb/description/SimpleConnectedComponentsSegmentation_vector.txt
@@ -0,0 +1,18 @@
+SimpleConnectedComponentsSegmentationVector
+otbcli_Segmentation
+Simple Connected Components segmentation (large-scale, vector output)
+Segmentation
+ParameterRaster|-filter cc -in|Input Image|False
+ParameterString|-filter.cc.expr|Condition|
+OutputVector|-mode vector -mode.vector.out|Output vector file
+ParameterVector|-mode.vector.inmask|Mask Image|-1|True
+ParameterBoolean|-mode.vector.neighbor|8-neighbor connectivity|False
+ParameterBoolean|-mode.vector.stitch|Stitch polygons|True
+ParameterNumber|-mode.vector.minsize|Minimum object size|1|None|1
+ParameterNumber|-mode.vector.simplify|Simplify polygons|None|None|0.0
+ParameterString|-mode.vector.layername|Layer name |layer
+ParemeterString|-mode.vector.fieldname|Geometry index field name|DN
+ParameterNumber|-mode.vector.tilesize|Tile size|0|None|1024
+ParameterNumber|-mode.vector.startlabel|Starting geometry index|1|None|1
+ParameterSelection|-mode.vector.outmode|Writing mode (update file/overwrite file/overwrite layer/update layer)|ulco;ovw;ulovw;ulu|0
+ParameterString|-mode.vector.ogroptions|OGR options for layer creation|
diff --git a/otb/description/WatershedSegmentation.txt b/otb/description/WatershedSegmentation.txt
new file mode 100644
index 0000000..79b062e
--- /dev/null
+++ b/otb/description/WatershedSegmentation.txt
@@ -0,0 +1,9 @@
+WatershedSegmentation
+otbcli_Segmentation
+Watershed segmentation (labeled raster output)
+Segmentation
+ParameterRaster|-filter watershed -in|Input Image|False
+ParameterNumber|-filter.watershed.threshold|Depth Threshold|0|None|0.01
+ParameterNumber|-filter.watershed.level|Flood level|0|None|0.1
+OutputRaster|-mode raster -mode.raster.out|Output labeled image
+
diff --git a/otb/description/WatershedSegmentation_vector.txt b/otb/description/WatershedSegmentation_vector.txt
new file mode 100644
index 0000000..0f7e76b
--- /dev/null
+++ b/otb/description/WatershedSegmentation_vector.txt
@@ -0,0 +1,19 @@
+WatershedSegmentationVector
+otbcli_Segmentation
+Watershed segmentation (large-scale, vector output)
+Segmentation
+ParameterRaster|-filter watershed -in|Input Image|False
+ParameterNumber|-filter.watershed.threshold|Depth Threshold|0|None|0.01
+ParameterNumber|-filter.watershed.level|Flood level|0|None|0.1
+OutputVector|-mode vector -mode.vector.out|Output vector file
+ParameterVector|-mode.vector.inmask|Mask Image|-1|True
+ParameterBoolean|-mode.vector.neighbor|8-neighbor connectivity|False
+ParameterBoolean|-mode.vector.stitch|Stitch polygons|True
+ParameterNumber|-mode.vector.minsize|Minimum object size|1|None|1
+ParameterNumber|-mode.vector.simplify|Simplify polygons|None|None|0.0
+ParameterString|-mode.vector.layername|Layer name |layer
+ParemeterString|-mode.vector.fieldname|Geometry index field name|DN
+ParameterNumber|-mode.vector.tilesize|Tile size|0|None|1024
+ParameterNumber|-mode.vector.startlabel|Starting geometry index|1|None|1
+ParameterSelection|-mode.vector.outmode|Writing mode (update file/overwrite file/overwrite layer/update layer)|ulco;ovw;ulovw;ulu|0
+ParameterString|-mode.vector.ogroptions|OGR options for layer creation|
\ No newline at end of file
@@ -17,6 +17,7 @@
***************************************************************************
"""
from sextante.admintools.PostGISExecuteSQL import PostGISExecuteSQL
from sextante.admintools.ImportIntoPostGIS import ImportIntoPostGIS

__author__ = 'Victor Olaya'
__date__ = 'October 2012'
@@ -40,7 +41,7 @@ def __init__(self):
AlgorithmProvider.__init__(self)
self.alglist = [ImportVectorIntoGeoServer(), ImportRasterIntoGeoServer(),
CreateWorkspace(), DeleteWorkspace(), DeleteDatastore(),
CreateStyleGeoServer(), PostGISExecuteSQL()]#, TruncateSeedGWC()]
CreateStyleGeoServer(), PostGISExecuteSQL(), ImportIntoPostGIS()]#, TruncateSeedGWC()]

def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
@@ -3,4 +3,4 @@ FILE(GLOB PY_FILES *.py)
ADD_SUBDIRECTORY(geoserver)
ADD_SUBDIRECTORY(httplib2)

PLUGIN_INSTALL(sextante admintools ${PY_FILES})
PLUGIN_INSTALL(sextante ./admintools ${PY_FILES})
@@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
ImportIntoPostGIS.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 sextante.parameters.ParameterVector import ParameterVector
from sextante.core.GeoAlgorithm import GeoAlgorithm

__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$'

import os
from qgis.core import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from sextante.parameters.ParameterString import ParameterString
from sextante.admintools import postgis_utils
import PyQt4

class ImportIntoPostGIS(GeoAlgorithm):

DATABASE = "DATABASE"
TABLENAME = "TABLENAME"
INPUT = "INPUT"

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

def processAlgorithm(self, progress):
pass

def defineCharacteristics(self):
self.name = "Import into PostGIS"
self.group = "PostGIS management tools"
self.addParameter(ParameterVector(self.INPUT, "Layer to import"))
self.addParameter(ParameterString(self.DATABASE, "Database"))
self.addParameter(ParameterString(self.TABLENAME, "Name for new table"))




@@ -5,7 +5,7 @@
PostGISExecuteSQL.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya
Copyright : (C) 2012 by Victor Olaya, Carterix Geomatics
Email : volayaf at gmail dot com
***************************************************************************
* *
@@ -16,13 +16,11 @@
* *
***************************************************************************
"""
from sextante.admintools import postgis_utils
from sextante.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
import PyQt4
from sextante.core.GeoAlgorithm import GeoAlgorithm

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

@@ -31,9 +29,11 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from sextante.parameters.ParameterString import ParameterString
from sextante.admintools.GeoServerToolsAlgorithm import GeoServerToolsAlgorithm
from sextante.admintools import postgis_utils
from sextante.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
import PyQt4

class PostGISExecuteSQL(GeoServerToolsAlgorithm):
class PostGISExecuteSQL(GeoAlgorithm):

DATABASE = "DATABASE"
SQL = "SQL"
@@ -132,12 +132,11 @@ def processAlgorithm(self, progress):
#=======================================================================

def defineCharacteristics(self):
self.addBaseParameters()
self.name = "PostGIS execute SQL"
self.group = "PostGIS management tools"
self.addParameter(ParameterString(self.DATABASE, "Database"))
self.addParameter(ParameterString(self.TABLENAME, "Name for new table"))
self.addParameter(ParameterString(self.SQL, "SQL query"))
self.addParameter(ParameterString(self.SQL, "SQL query", True))



@@ -1,3 +1,3 @@
FILE(GLOB PY_FILES *.py)

PLUGIN_INSTALL(sextante admintools/geoserver ${PY_FILES})
PLUGIN_INSTALL(sextante ./admintools/geoserver ${PY_FILES})
@@ -1,3 +1,3 @@
FILE(GLOB PY_FILES *.py)

PLUGIN_INSTALL(sextante admintools/httplib2 ${PY_FILES})
PLUGIN_INSTALL(sextante ./admintools/httplib2 ${PY_FILES})

0 comments on commit 27f197c

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