Showing with 218 additions and 15 deletions.
  1. +0 −8 .settings/org.eclipse.core.resources.prefs
  2. +1 −0 doc/AUTHORS
  3. +1 −1 python/plugins/CMakeLists.txt
  4. +0 −2 python/plugins/sextante/.gitignore
  5. +28 −0 python/plugins/sextante/CMakeLists.txt
  6. +5 −0 python/plugins/sextante/about/CMakeLists.txt
  7. +3 −0 python/plugins/sextante/algs/CMakeLists.txt
  8. +3 −0 python/plugins/sextante/core/CMakeLists.txt
  9. +49 −0 python/plugins/sextante/core/SextanteVectorWriter.py
  10. +7 −0 python/plugins/sextante/ftools/CMakeLists.txt
  11. +7 −0 python/plugins/sextante/gdal/CMakeLists.txt
  12. +3 −0 python/plugins/sextante/gdal/scripts/CMakeLists.txt
  13. +7 −0 python/plugins/sextante/grass/CMakeLists.txt
  14. +5 −0 python/plugins/sextante/gui/CMakeLists.txt
  15. +9 −0 python/plugins/sextante/help/CMakeLists.txt
  16. +3 −0 python/plugins/sextante/images/CMakeLists.txt
  17. +6 −0 python/plugins/sextante/lidar/CMakeLists.txt
  18. +3 −0 python/plugins/sextante/lidar/fusion/CMakeLists.txt
  19. +3 −0 python/plugins/sextante/lidar/lastools/CMakeLists.txt
  20. +7 −0 python/plugins/sextante/mmqgisx/CMakeLists.txt
  21. +3 −0 python/plugins/sextante/modeler/CMakeLists.txt
  22. +3 −2 python/plugins/sextante/modeler/ModelerUtils.py
  23. +7 −0 python/plugins/sextante/otb/CMakeLists.txt
  24. +3 −0 python/plugins/sextante/outputs/CMakeLists.txt
  25. +3 −0 python/plugins/sextante/parameters/CMakeLists.txt
  26. +8 −0 python/plugins/sextante/pymorph/CMakeLists.txt
  27. +5 −0 python/plugins/sextante/pymorph/html/CMakeLists.txt
  28. +15 −0 python/plugins/sextante/pymorph/html/morph/CMakeLists.txt
  29. +3 −0 python/plugins/sextante/pymorph/scripts/CMakeLists.txt
  30. +5 −0 python/plugins/sextante/r/CMakeLists.txt
  31. +7 −0 python/plugins/sextante/saga/CMakeLists.txt
  32. +3 −0 python/plugins/sextante/script/CMakeLists.txt
  33. +3 −2 python/plugins/sextante/script/ScriptUtils.py
8 changes: 0 additions & 8 deletions .settings/org.eclipse.core.resources.prefs

This file was deleted.

1 change: 1 addition & 0 deletions doc/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ Sergey Yakushev <yakushevs at gmail.com >
René-Luc D'Hont <rldhont at gmail.com>
Etienne Tourigny <etourigny.dev at gmail.com>
Larry Shaffer <larrys at dakotacarto.com>
Victor Olaya <volayaf at gmail.com>
2 changes: 1 addition & 1 deletion python/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ ADD_SUBDIRECTORY(fTools)
ADD_SUBDIRECTORY(GdalTools)
ADD_SUBDIRECTORY(osm)
ADD_SUBDIRECTORY(db_manager)
#ADD_SUBDIRECTORY(sextante)
ADD_SUBDIRECTORY(sextante)
2 changes: 0 additions & 2 deletions python/plugins/sextante/.gitignore

This file was deleted.

28 changes: 28 additions & 0 deletions python/plugins/sextante/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
SET (SEXTANTE_PLUGIN_DIR ${QGIS_DATA_DIR}/python/plugins/sextante)

ADD_SUBDIRECTORY(about)
ADD_SUBDIRECTORY(algs)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(ftools)
ADD_SUBDIRECTORY(gdal)
ADD_SUBDIRECTORY(grass)
ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(help)
ADD_SUBDIRECTORY(images)
ADD_SUBDIRECTORY(lidar)
ADD_SUBDIRECTORY(mmqgisx)
ADD_SUBDIRECTORY(modeler)
ADD_SUBDIRECTORY(otb)
ADD_SUBDIRECTORY(outputs)
ADD_SUBDIRECTORY(parameters)
ADD_SUBDIRECTORY(pymorph)
ADD_SUBDIRECTORY(r)
ADD_SUBDIRECTORY(saga)
ADD_SUBDIRECTORY(script)
#ADD_SUBDIRECTORY(tests)

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

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR})
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR})
5 changes: 5 additions & 0 deletions python/plugins/sextante/about/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES *.htm *.png)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/about)
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/about)
3 changes: 3 additions & 0 deletions python/plugins/sextante/algs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/algs)
3 changes: 3 additions & 0 deletions python/plugins/sextante/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/core)
49 changes: 49 additions & 0 deletions python/plugins/sextante/core/SextanteVectorWriter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from PyQt4.QtCore import *

from qgis.core import *

class SextanteVectorWriter:

MEMORY_LAYER_PREFIX = "memory:"

TYPE_MAP = {QGis.WKBPoint : "Point",
QGis.WKBLineString : "LineString",
QGis.WKBPolygon : "Polygon",
QGis.WKBMultiPoint : "MultiPoint",
QGis.WKBMultiLineString : "MultiLineString",
QGis.WKBMultiPolygon : "MultiPolygon"
}

def __init__(self, fileName, encoding, fields, geometryType, crs, options=None):
self.fileName = fileName
self.isMemory = False
self.memLayer = None
self.writer = None

if self.fileName.startswith(self.MEMORY_LAYER_PREFIX):
self.isMemory = True

uri = self.TYPE_MAP[geometryType]
if crs.isValid():
uri += "?crs=" + crs.authid()
self.memLayer = QgsVectorLayer(uri, self.fileName, "memory")
self.writer = self.memLayer.dataProvider()
self.writer.addAttributes(fields.values())
self.memLayer.updateFieldMap()
else:
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
OGRCodes = {}
for key, value in formats.items():
extension = str(key)
extension = extension[extension.find('*.') + 2:]
extension = extension[:extension.find(" ")]
OGRCodes[extension] = value

extension = self.fileName[self.fileName.find(".") + 1:]
self.writer = QgsVectorFileWriter(self.fileName, encoding, fields, geometryType, crs, OGRCodes[extension])

def addFeature(self, feature):
if self.isMemory:
self.writer.addFeatures([feature])
else:
self.writer.addFeature(feature)
7 changes: 7 additions & 0 deletions python/plugins/sextante/ftools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES copyright.txt)
FILE(GLOB ICON_FILES icons/*.png)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/ftools)
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/ftools)
INSTALL(FILES ${ICON_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/ftools/icons)
7 changes: 7 additions & 0 deletions python/plugins/sextante/gdal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB ICON_FILES icons/*.png)

ADD_SUBDIRECTORY(scripts)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/gdal)
INSTALL(FILES ${ICON_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/gdal/icons)
3 changes: 3 additions & 0 deletions python/plugins/sextante/gdal/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/gdal/scripts)
7 changes: 7 additions & 0 deletions python/plugins/sextante/grass/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES grass.txt)
FILE(GLOB DESCR_FILES description/*.txt)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/grass)
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/grass)
INSTALL(FILES ${DESCR_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/grass/description)
5 changes: 5 additions & 0 deletions python/plugins/sextante/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES help/*.*)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/gui)
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/gui/help)
9 changes: 9 additions & 0 deletions python/plugins/sextante/help/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FILE(GLOB HTML_FILES *.html)
FILE(GLOB OTHER_FILES *.js)
FILE(GLOB IMAGE_FILES _images/*.*)
FILE(GLOB STATIC_FILES _static/*.*)

INSTALL(FILES ${HTML_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/help)
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/help)
INSTALL(FILES ${IMAGE_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/help/_images)
INSTALL(FILES ${STATIC_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/help/_static)
3 changes: 3 additions & 0 deletions python/plugins/sextante/images/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB IMAGE_FILES *.png)

INSTALL(FILES ${IMAGE_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/images)
6 changes: 6 additions & 0 deletions python/plugins/sextante/lidar/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FILE(GLOB PY_FILES *.py)

ADD_SUBDIRECTORY(fusion)
ADD_SUBDIRECTORY(lastools)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/lidar)
3 changes: 3 additions & 0 deletions python/plugins/sextante/lidar/fusion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/lidar/fusion)
3 changes: 3 additions & 0 deletions python/plugins/sextante/lidar/lastools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/lidar/lastools)
7 changes: 7 additions & 0 deletions python/plugins/sextante/mmqgisx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES copyright.txt)
FILE(GLOB ICON_FILES icons/*.png)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/mmqgisx)
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/mmqgisx)
INSTALL(FILES ${ICON_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/mmqgisx/icons)
3 changes: 3 additions & 0 deletions python/plugins/sextante/modeler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/modeler)
5 changes: 3 additions & 2 deletions python/plugins/sextante/modeler/ModelerUtils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from sextante.core.SextanteUtils import SextanteUtils
from sextante.core.SextanteUtils import mkdir
from sextante.core.SextanteConfig import SextanteConfig

Expand All @@ -11,8 +12,8 @@ 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"
#folder = os.path.join(os.path.dirname(__file__), "models")
folder = SextanteUtils.userFolder() + os.sep + "models"
mkdir(folder)

return folder
Expand Down
7 changes: 7 additions & 0 deletions python/plugins/sextante/otb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB DESCR_FILES description/*.txt)
FILE(GLOB HELPER_FILES helper/*.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/otb)
INSTALL(FILES ${DESCR_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/otb/description)
INSTALL(FILES ${HELPER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/otb/helper)
3 changes: 3 additions & 0 deletions python/plugins/sextante/outputs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/outputs)
3 changes: 3 additions & 0 deletions python/plugins/sextante/parameters/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/parameters)
8 changes: 8 additions & 0 deletions python/plugins/sextante/pymorph/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES algnames.txt)

ADD_SUBDIRECTORY(html)
ADD_SUBDIRECTORY(scripts)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph)
INSTALL(FILES ${OTHER_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph)
5 changes: 5 additions & 0 deletions python/plugins/sextante/pymorph/html/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FILE(GLOB HTML_FILES *.html)

ADD_SUBDIRECTORY(morph)

INSTALL(FILES ${HTML_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html)
15 changes: 15 additions & 0 deletions python/plugins/sextante/pymorph/html/morph/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FILE(GLOB HTML_FILES *.html *.css)
FILE(GLOB GIF_FILES *.gif)
FILE(GLOB IMAGES_FILES images/*.*)
FILE(GLOB MMDEMOS_FILES mmdemos/*.*)
FILE(GLOB MMINFO_FILES mminfo/*.*)
FILE(GLOB MMTYPES_FILES mmtype/*.*)
FILE(GLOB MORPH_FILES morph/*.*)

INSTALL(FILES ${HTML_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html/morph)
INSTALL(FILES ${GIF_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html/morph)
INSTALL(FILES ${IMAGES_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html/morph/images)
INSTALL(FILES ${MMDEMOS_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html/morph/mmdemos)
INSTALL(FILES ${MMINFO_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html/morph/mminfo)
INSTALL(FILES ${MMTYPES_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html/morph/mmtypes)
INSTALL(FILES ${MORPH_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/html/morph/morph)
3 changes: 3 additions & 0 deletions python/plugins/sextante/pymorph/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/pymorph/scripts)
5 changes: 5 additions & 0 deletions python/plugins/sextante/r/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB SCRIPT_FILES scripts/*.rsx)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/r)
INSTALL(FILES ${SCRIPT_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/r/scripts)
7 changes: 7 additions & 0 deletions python/plugins/sextante/saga/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB DESCR_FILES description/*.txt)
FILE(GLOB HELP_FILES help/*.html)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/saga)
INSTALL(FILES ${DESCR_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/saga/description)
INSTALL(FILES ${HELP_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/saga/help)
3 changes: 3 additions & 0 deletions python/plugins/sextante/script/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILE(GLOB PY_FILES *.py)

INSTALL(FILES ${PY_FILES} DESTINATION ${SEXTANTE_PLUGIN_DIR}/script)
5 changes: 3 additions & 2 deletions python/plugins/sextante/script/ScriptUtils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from sextante.core.SextanteUtils import SextanteUtils
from sextante.core.SextanteUtils import mkdir
from sextante.core.SextanteConfig import SextanteConfig

Expand All @@ -11,8 +12,8 @@ class ScriptUtils:
def scriptsFolder():
folder = SextanteConfig.getSetting(ScriptUtils.SCRIPTS_FOLDER)
if folder == None:
folder = os.path.join(os.path.dirname(__file__), "scripts")
#folder = SextanteUtils.userFolder() + os.sep + "scripts"
#folder = os.path.join(os.path.dirname(__file__), "scripts")
folder = SextanteUtils.userFolder() + os.sep + "scripts"
mkdir(folder)

return folder
Expand Down