Skip to content
Permalink
Browse files
Merge branch 'master' of github.com:qgis/Quantum-GIS
  • Loading branch information
mhugent committed Dec 21, 2012
2 parents ac52671 + 0d9dcb5 commit 79947fe94237a8737a806719dadbae530a457f28
Showing with 10,173 additions and 7,363 deletions.
  1. +30 −30 doc/TRANSLATORS
  2. +654 −555 i18n/qgis_de.ts
  3. +7,896 −5,648 i18n/qgis_ro.ts
  4. +3 −1 python/core/raster/qgsrasterdataprovider.sip
  5. +0 −2 python/plugins/sextante/CMakeLists.txt
  6. +8 −7 python/plugins/sextante/SextantePlugin.py
  7. +0 −11 python/plugins/sextante/add_weights_to_r.neighbors.patch
  8. +5 −3 python/plugins/sextante/algs/AddTableField.py
  9. +5 −3 python/plugins/sextante/algs/AutoincrementalField.py
  10. +3 −0 python/plugins/sextante/algs/CMakeLists.txt
  11. +5 −3 python/plugins/sextante/algs/EquivalentNumField.py
  12. +5 −3 python/plugins/sextante/algs/Explode.py
  13. +6 −4 python/plugins/sextante/algs/FieldPyculator.py
  14. +5 −3 python/plugins/sextante/algs/FieldsCalculator.py
  15. +147 −0 python/plugins/sextante/algs/QGISAlgorithmProvider.py
  16. +5 −3 python/plugins/sextante/algs/SaveSelectedFeatures.py
  17. +0 −64 python/plugins/sextante/algs/SextanteAlgorithmProvider.py
  18. +6 −4 python/plugins/sextante/{ → algs}/ftools/BasicStatisticsNumbers.py
  19. +6 −5 python/plugins/sextante/{ → algs}/ftools/BasicStatisticsStrings.py
  20. 0 python/plugins/sextante/{ → algs}/ftools/Buffer.py
  21. +6 −0 python/plugins/sextante/algs/ftools/CMakeLists.txt
  22. +6 −9 python/plugins/sextante/{ → algs}/ftools/Centroids.py
  23. +6 −4 python/plugins/sextante/{ → algs}/ftools/Clip.py
  24. +6 −4 python/plugins/sextante/{ → algs}/ftools/ConvexHull.py
  25. +6 −4 python/plugins/sextante/{ → algs}/ftools/Delaunay.py
  26. +1 −1 python/plugins/sextante/{ → algs}/ftools/DensifyGeometries.py
  27. +3 −5 python/plugins/sextante/{ → algs}/ftools/DensifyGeometriesInterval.py
  28. +6 −5 python/plugins/sextante/{ → algs}/ftools/Difference.py
  29. +5 −4 python/plugins/sextante/{ → algs}/ftools/Dissolve.py
  30. +7 −7 python/plugins/sextante/{ → algs}/ftools/ExportGeometryInfo.py
  31. +5 −3 python/plugins/sextante/{ → algs}/ftools/ExtentFromLayer.py
  32. +7 −6 python/plugins/sextante/{ → algs}/ftools/ExtractNodes.py
  33. +1 −1 python/plugins/sextante/{ → algs}/ftools/FToolsAlgorithmProvider.py
  34. 0 python/plugins/sextante/{ → algs}/ftools/FToolsUtils.py
  35. +6 −4 python/plugins/sextante/{ → algs}/ftools/FixedDistanceBuffer.py
  36. +6 −4 python/plugins/sextante/{ → algs}/ftools/Intersection.py
  37. +7 −8 python/plugins/sextante/{ → algs}/ftools/LinesIntersection.py
  38. +6 −5 python/plugins/sextante/{ → algs}/ftools/LinesToPolygons.py
  39. +6 −4 python/plugins/sextante/{ → algs}/ftools/MeanCoords.py
  40. +5 −3 python/plugins/sextante/{ → algs}/ftools/MultipartToSingleparts.py
  41. +6 −4 python/plugins/sextante/{ → algs}/ftools/NearestNeighbourAnalysis.py
  42. +5 −3 python/plugins/sextante/{ → algs}/ftools/PointDistance.py
  43. +6 −4 python/plugins/sextante/{ → algs}/ftools/PointsInPolygon.py
  44. +6 −4 python/plugins/sextante/{ → algs}/ftools/PointsInPolygonUnique.py
  45. +6 −4 python/plugins/sextante/{ → algs}/ftools/PointsInPolygonWeighted.py
  46. +5 −3 python/plugins/sextante/{ → algs}/ftools/PolygonsToLines.py
  47. +5 −3 python/plugins/sextante/{ → algs}/ftools/RandomSelection.py
  48. +6 −4 python/plugins/sextante/{ → algs}/ftools/RandomSelectionWithinSubsets.py
  49. +5 −3 python/plugins/sextante/{ → algs}/ftools/ReprojectLayer.py
  50. +6 −4 python/plugins/sextante/{ → algs}/ftools/SelectByLocation.py
  51. +6 −5 python/plugins/sextante/{ → algs}/ftools/SimplifyGeometries.py
  52. +5 −3 python/plugins/sextante/{ → algs}/ftools/SinglePartsToMultiparts.py
  53. +6 −4 python/plugins/sextante/{ → algs}/ftools/SumLines.py
  54. +6 −4 python/plugins/sextante/{ → algs}/ftools/Union.py
  55. +5 −4 python/plugins/sextante/{ → algs}/ftools/UniqueValues.py
  56. +6 −4 python/plugins/sextante/{ → algs}/ftools/VariableDistanceBuffer.py
  57. +6 −6 python/plugins/sextante/{ → algs}/ftools/VoronoiPolygons.py
  58. 0 python/plugins/sextante/{ → algs}/ftools/__init__.py
  59. 0 python/plugins/sextante/{ → algs}/ftools/copyright.txt
  60. 0 python/plugins/sextante/{ → algs}/ftools/ftools_utils.py
  61. BIN python/plugins/sextante/{ → algs}/ftools/icons/analysis.png
  62. BIN python/plugins/sextante/{ → algs}/ftools/icons/basic_statistics.png
  63. BIN python/plugins/sextante/{ → algs}/ftools/icons/buffer.png
  64. BIN python/plugins/sextante/{ → algs}/ftools/icons/centroids.png
  65. BIN python/plugins/sextante/{ → algs}/ftools/icons/check_geometry.png
  66. BIN python/plugins/sextante/{ → algs}/ftools/icons/clip.png
  67. BIN python/plugins/sextante/{ → algs}/ftools/icons/convex_hull.png
  68. BIN python/plugins/sextante/{ → algs}/ftools/icons/define_projection.png
  69. BIN python/plugins/sextante/{ → algs}/ftools/icons/delaunay.png
  70. BIN python/plugins/sextante/{ → algs}/ftools/icons/difference.png
  71. BIN python/plugins/sextante/{ → algs}/ftools/icons/dissolve.png
  72. BIN python/plugins/sextante/{ → algs}/ftools/icons/export_geometry.png
  73. BIN python/plugins/sextante/{ → algs}/ftools/icons/export_projection.png
  74. BIN python/plugins/sextante/{ → algs}/ftools/icons/extract_nodes.png
  75. BIN python/plugins/sextante/{ → algs}/ftools/icons/ftools_logo.png
  76. BIN python/plugins/sextante/{ → algs}/ftools/icons/geometry.png
  77. BIN python/plugins/sextante/{ → algs}/ftools/icons/geoprocessing.png
  78. BIN python/plugins/sextante/{ → algs}/ftools/icons/help.png
  79. BIN python/plugins/sextante/{ → algs}/ftools/icons/intersect.png
  80. BIN python/plugins/sextante/{ → algs}/ftools/icons/intersections.png
  81. BIN python/plugins/sextante/{ → algs}/ftools/icons/join_attributes.png
  82. BIN python/plugins/sextante/{ → algs}/ftools/icons/join_location.png
  83. BIN python/plugins/sextante/{ → algs}/ftools/icons/layer_extent.png
  84. BIN python/plugins/sextante/{ → algs}/ftools/icons/management.png
  85. BIN python/plugins/sextante/{ → algs}/ftools/icons/matrix.png
  86. BIN python/plugins/sextante/{ → algs}/ftools/icons/mean.png
  87. BIN python/plugins/sextante/{ → algs}/ftools/icons/merge_shapes.png
  88. BIN python/plugins/sextante/{ → algs}/ftools/icons/multi_to_single.png
  89. BIN python/plugins/sextante/{ → algs}/ftools/icons/neighbour.png
  90. BIN python/plugins/sextante/{ → algs}/ftools/icons/random_points.png
  91. BIN python/plugins/sextante/{ → algs}/ftools/icons/random_selection.png
  92. BIN python/plugins/sextante/{ → algs}/ftools/icons/regular_points.png
  93. BIN python/plugins/sextante/{ → algs}/ftools/icons/reproject.png
  94. BIN python/plugins/sextante/{ → algs}/ftools/icons/sampling.png
  95. BIN python/plugins/sextante/{ → algs}/ftools/icons/select_location.png
  96. BIN python/plugins/sextante/{ → algs}/ftools/icons/simplify.png
  97. BIN python/plugins/sextante/{ → algs}/ftools/icons/single_to_multi.png
  98. BIN python/plugins/sextante/{ → algs}/ftools/icons/split_layer.png
  99. BIN python/plugins/sextante/{ → algs}/ftools/icons/sub_selection.png
  100. BIN python/plugins/sextante/{ → algs}/ftools/icons/sum_lines.png
  101. BIN python/plugins/sextante/{ → algs}/ftools/icons/sum_points.png
  102. BIN python/plugins/sextante/{ → algs}/ftools/icons/sym_difference.png
  103. BIN python/plugins/sextante/{ → algs}/ftools/icons/to_lines.png
  104. BIN python/plugins/sextante/{ → algs}/ftools/icons/union.png
  105. BIN python/plugins/sextante/{ → algs}/ftools/icons/unique.png
  106. BIN python/plugins/sextante/{ → algs}/ftools/icons/vector_grid.png
  107. BIN python/plugins/sextante/{ → algs}/ftools/icons/voronoi.png
  108. 0 python/plugins/sextante/{ → algs}/ftools/voronoi.py
  109. +6 −0 python/plugins/sextante/algs/mmqgisx/CMakeLists.txt
  110. +204 −266 python/plugins/sextante/{mmqgisx/MMQGISXAlgorithmProvider.py → algs/mmqgisx/MMQGISXAlgorithms.py}
  111. 0 python/plugins/sextante/{ → algs}/mmqgisx/__init__.py
  112. 0 python/plugins/sextante/{ → algs}/mmqgisx/copyright.txt
  113. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis.png
  114. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_animate_columns.png
  115. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_animate_rows.png
  116. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_attribute_export.png
  117. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_attribute_join.png
  118. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_color_map.png
  119. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_float_to_text.png
  120. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_geocode_google.png
  121. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_geocode_street_layer.png
  122. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_grid.png
  123. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_gridify.png
  124. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_hub_distance.png
  125. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_label.png
  126. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_merge.png
  127. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_select.png
  128. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_simplify.png
  129. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_sort.png
  130. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_text_to_float.png
  131. BIN python/plugins/sextante/{ → algs}/mmqgisx/icons/mmqgis_voronoi.png
  132. +52 −156 python/plugins/sextante/{ → algs}/mmqgisx/mmqgisx_library.py
  133. +2 −8 python/plugins/sextante/core/Sextante.py
  134. +3 −3 python/plugins/sextante/core/SextanteUtils.py
  135. +0 −6 python/plugins/sextante/ftools/CMakeLists.txt
  136. +19 −6 python/plugins/sextante/grass/GrassAlgorithm.py
  137. +4 −4 python/plugins/sextante/grass/description/r.grow.distance.txt
  138. +3 −3 python/plugins/sextante/grass/description/r.grow.txt
  139. +7 −7 python/plugins/sextante/grass/description/r.his.txt
  140. BIN python/plugins/sextante/images/qgis.png
  141. BIN python/plugins/sextante/images/tool.png
  142. +0 −6 python/plugins/sextante/mmqgisx/CMakeLists.txt
  143. +58 −6 python/plugins/sextante/modeler/ModelerAlgorithm.py
  144. +17 −15 python/plugins/sextante/modeler/ModelerParametersDialog.py
  145. +2 −2 python/plugins/sextante/modeler/ModelerUtils.py
  146. +2 −0 python/plugins/sextante/parameters/ParameterExtent.py
  147. +4 −11 python/plugins/sextante/r/RUtils.py
  148. +0 −8 python/plugins/sextante/saga/description/Trend(Analysis)Shapes.txt
  149. +0 −8 python/plugins/sextante/saga/description/TrendAnalysis.txt
  150. +2 −3 python/plugins/sextante/script/ScriptAlgorithm.py
  151. +2 −2 python/plugins/sextante/script/ScriptUtils.py
  152. +1 −1 scripts/tsstat.pl
  153. +8 −1 src/app/qgisapp.cpp
  154. +5 −11 src/core/raster/qgscontrastenhancement.cpp
  155. +27 −0 src/core/raster/qgsrasterdataprovider.cpp
  156. +11 −0 src/core/raster/qgsrasterdataprovider.h
  157. +200 −131 src/core/raster/qgsrasterfilewriter.cpp
  158. +17 −7 src/core/raster/qgsrasterfilewriter.h
  159. +58 −9 src/gui/qgsrasterlayersaveasdialog.cpp
  160. +8 −4 src/gui/qgsrubberband.cpp
  161. +1 −1 src/plugins/grass/qgsgrassplugin.cpp
  162. +2 −2 src/plugins/grass/qgsgrassregion.cpp
  163. +42 −46 src/providers/gdal/qgsgdalprovider.cpp
  164. +9 −1 src/providers/gdal/qgsgdalprovider.h
  165. +46 −8 src/providers/grass/CMakeLists.txt
  166. +72 −8 src/providers/grass/qgsgrassgislib.cpp
  167. +121 −117 src/ui/qgsrasterlayersaveasdialogbase.ui
  168. +1 −0 tests/src/core/CMakeLists.txt
  169. +171 −0 tests/src/core/testqgsrastersublayer.cpp
  170. BIN tests/testdata/landsat2.nc

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -249,7 +249,9 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface

/** Creates a new dataset with mDataSourceURI
@return true in case of success*/
virtual bool create( const QString& format, int nBands,
static QgsRasterDataProvider* create( const QString &providerKey,
const QString &uri,
const QString& format, int nBands,
QGis::DataType type,
int width, int height, double* geoTransform,
const QgsCoordinateReferenceSystem& crs,
@@ -3,13 +3,11 @@ SET (SEXTANTE_PLUGIN_DIR ${QGIS_DATA_DIR}/python/plugins/sextante)
ADD_SUBDIRECTORY(admintools)
ADD_SUBDIRECTORY(algs)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(ftools)
ADD_SUBDIRECTORY(gdal)
ADD_SUBDIRECTORY(grass)
ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(images)
ADD_SUBDIRECTORY(lidar)
ADD_SUBDIRECTORY(mmqgisx)
ADD_SUBDIRECTORY(modeler)
ADD_SUBDIRECTORY(otb)
ADD_SUBDIRECTORY(outputs)
@@ -110,13 +110,14 @@ def unload(self):
self.menu.deleteLater()
#delete temporary output files
folder = SextanteUtils.tempFolder()
for f in os.listdir(folder):
path = os.path.join(folder,f)
try:
os.unlink(path)
except:
#leave files that could not be deleted
pass
if QDir(folder).exists():
for f in os.listdir(folder):
path = os.path.join(folder, f)
try:
os.unlink(path)
except:
#leave files that could not be deleted
pass

def openToolbox(self):
if self.toolbox.isVisible():

This file was deleted.

@@ -45,12 +45,14 @@ class AddTableField(GeoAlgorithm):
TYPE_NAMES = ["Integer", "Float", "String"]
TYPES = [QVariant.Int, QVariant.Double, QVariant.String]

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/toolbox.png")
#===========================================================================
# def getIcon(self):
# return QtGui.QIcon(os.path.dirname(__file__) + "/../images/qgis.png")
#===========================================================================

def defineCharacteristics(self):
self.name = "Add field to attributes table"
self.group = "Algorithms for vector layers"
self.group = "Vector table tools"
self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", ParameterVector.VECTOR_TYPE_ANY, False))
self.addParameter(ParameterString(self.FIELD_NAME, "Field name"))
self.addParameter(ParameterSelection(self.FIELD_TYPE, "Field type", self.TYPE_NAMES))
@@ -37,8 +37,10 @@ class AutoincrementalField(GeoAlgorithm):
INPUT = "INPUT"
OUTPUT = "OUTPUT"

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

def processAlgorithm(self, progress):
output = self.getOutputFromName(self.OUTPUT)
@@ -67,7 +69,7 @@ def processAlgorithm(self, progress):

def defineCharacteristics(self):
self.name = "Add autoincremental field"
self.group = "Algorithms for vector layers"
self.group = "Vector table tools"
self.addParameter(ParameterVector(self.INPUT, "Input layer", ParameterVector.VECTOR_TYPE_ANY))
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

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

ADD_SUBDIRECTORY(mmqgisx)
ADD_SUBDIRECTORY(ftools)

PLUGIN_INSTALL(sextante ./algs ${PY_FILES})
@@ -39,8 +39,10 @@ class EquivalentNumField(GeoAlgorithm):
OUTPUT = "OUTPUT"
FIELD = "FIELD"

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/toolbox.png")
#===========================================================================
# def getIcon(self):
# return QtGui.QIcon(os.path.dirname(__file__) + "/../images/qgis.png")
#===========================================================================

def processAlgorithm(self, progress):
fieldname = self.getParameterValue(self.FIELD)
@@ -80,7 +82,7 @@ def processAlgorithm(self, progress):

def defineCharacteristics(self):
self.name = "Create equivalent numerical field"
self.group = "Algorithms for vector layers"
self.group = "Vector table tools"
self.addParameter(ParameterVector(self.INPUT, "Input layer", ParameterVector.VECTOR_TYPE_ANY))
self.addParameter(ParameterTableField(self.FIELD, "Class field", self.INPUT))
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))
@@ -38,8 +38,10 @@ class Explode(GeoAlgorithm):
INPUT = "INPUT"
OUTPUT = "OUTPUT"

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

def processAlgorithm(self, progress):
vlayer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
@@ -88,7 +90,7 @@ def getPolylineAsSingleSegments(self, polyline):

def defineCharacteristics(self):
self.name = "Explode lines"
self.group = "Algorithms for vector layers"
self.group = "Vector geometry tools"
self.addParameter(ParameterVector(self.INPUT, "Input layer",ParameterVector.VECTOR_TYPE_LINE))
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

@@ -48,12 +48,14 @@ class FieldsPyculator(GeoAlgorithm):
OUTPUT_LAYER ="OUTPUT_LAYER"
RESULT_VAR_NAME = "value"

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/toolbox.png")
#===========================================================================
# def getIcon(self):
# return QtGui.QIcon(os.path.dirname(__file__) + "/../images/qgis.png")
#===========================================================================

def defineCharacteristics(self):
self.name = "Field Pyculator"
self.group = "Algorithms for vector layers"
self.name = "Advanced Python field calculator"
self.group = "Vector table tools"
self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", ParameterVector.VECTOR_TYPE_ANY, False))
self.addParameter(ParameterBoolean(self.USE_SELECTED, "Use only selected features (all if noone selected)", False))
self.addParameter(ParameterString(self.FIELD_NAME, "Result field name", "NewField"))
@@ -43,12 +43,14 @@ class FieldsCalculator(GeoAlgorithm):
FORMULA = "FORMULA"
OUTPUT_LAYER ="OUTPUT_LAYER"

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + "/../images/toolbox.png")
#===========================================================================
# def getIcon(self):
# return QtGui.QIcon(os.path.dirname(__file__) + "/../images/qgis.png")
#===========================================================================

def defineCharacteristics(self):
self.name = "Field calculator"
self.group = "Algorithms for vector layers"
self.group = "Vector table tools"
self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", ParameterVector.VECTOR_TYPE_ANY, False))
self.addParameter(ParameterString(self.FIELD_NAME, "Result field name"))
self.addParameter(ParameterString(self.FORMULA, "Formula"))
@@ -0,0 +1,147 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
SextanteAlgorithmProvider.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$'

from sextante.algs.ftools.PointsInPolygon import PointsInPolygon
from sextante.algs.ftools.PointsInPolygonUnique import PointsInPolygonUnique
from sextante.algs.ftools.PointsInPolygonWeighted import PointsInPolygonWeighted
from sextante.algs.ftools.SumLines import SumLines
from sextante.algs.ftools.BasicStatisticsNumbers import BasicStatisticsNumbers
from sextante.algs.ftools.BasicStatisticsStrings import BasicStatisticsStrings
from sextante.algs.ftools.NearestNeighbourAnalysis import NearestNeighbourAnalysis
from sextante.algs.ftools.LinesIntersection import LinesIntersection
from sextante.algs.ftools.MeanCoords import MeanCoords
from sextante.algs.ftools.PointDistance import PointDistance
from sextante.algs.ftools.UniqueValues import UniqueValues
from sextante.algs.ftools.ReprojectLayer import ReprojectLayer
from sextante.algs.ftools.ExportGeometryInfo import ExportGeometryInfo
from sextante.algs.ftools.Centroids import Centroids
from sextante.algs.ftools.Delaunay import Delaunay
from sextante.algs.ftools.VoronoiPolygons import VoronoiPolygons
from sextante.algs.ftools.DensifyGeometries import DensifyGeometries
from sextante.algs.ftools.MultipartToSingleparts import MultipartToSingleparts
from sextante.algs.ftools.SimplifyGeometries import SimplifyGeometries
from sextante.algs.ftools.LinesToPolygons import LinesToPolygons
from sextante.algs.ftools.PolygonsToLines import PolygonsToLines
from sextante.algs.ftools.SinglePartsToMultiparts import SinglePartsToMultiparts
from sextante.algs.ftools.ExtractNodes import ExtractNodes
from sextante.algs.ftools.ConvexHull import ConvexHull
from sextante.algs.ftools.FixedDistanceBuffer import FixedDistanceBuffer
from sextante.algs.ftools.VariableDistanceBuffer import VariableDistanceBuffer
from sextante.algs.ftools.Clip import Clip
from sextante.algs.ftools.Difference import Difference
from sextante.algs.ftools.Dissolve import Dissolve
from sextante.algs.ftools.Intersection import Intersection
from sextante.algs.ftools.ExtentFromLayer import ExtentFromLayer
from sextante.algs.ftools.RandomSelection import RandomSelection
from sextante.algs.ftools.RandomSelectionWithinSubsets import RandomSelectionWithinSubsets
from sextante.algs.ftools.SelectByLocation import SelectByLocation
from sextante.algs.ftools.Union import Union
from sextante.algs.ftools.DensifyGeometriesInterval import DensifyGeometriesInterval
from sextante.algs.mmqgisx.MMQGISXAlgorithms import mmqgisx_attribute_export_algorithm,\
mmqgisx_attribute_join_algorithm, mmqgisx_delete_columns_algorithm,\
mmqgisx_delete_duplicate_geometries_algorithm,\
mmqgisx_geocode_google_algorithm, mmqgisx_geometry_convert_algorithm,\
mmqgisx_geometry_export_algorithm, mmqgisx_geometry_import_algorithm,\
mmqgisx_grid_algorithm, mmqgisx_gridify_algorithm,\
mmqgisx_hub_distance_algorithm, mmqgisx_hub_lines_algorithm,\
mmqgisx_label_point_algorithm, mmqgisx_merge_algorithm,\
mmqgisx_select_algorithm, mmqgisx_sort_algorithm,\
mmqgisx_text_to_float_algorithm, mmqgisx_voronoi_algorithm

from sextante.algs.EquivalentNumField import EquivalentNumField
from sextante.core.AlgorithmProvider import AlgorithmProvider
from sextante.algs.AddTableField import AddTableField
from PyQt4 import QtGui
import os
from sextante.algs.FieldsCalculator import FieldsCalculator
from sextante.algs.SaveSelectedFeatures import SaveSelectedFeatures
from sextante.algs.Explode import Explode
from sextante.algs.AutoincrementalField import AutoincrementalField
from sextante.algs.FieldPyculator import FieldsPyculator

class QGISAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.alglist = [AddTableField(), FieldsCalculator(), SaveSelectedFeatures(),
AutoincrementalField(), Explode(), FieldsPyculator(), EquivalentNumField(),
#FTOOLS
SumLines(), PointsInPolygon(), PointsInPolygonWeighted(), PointsInPolygonUnique(),
BasicStatisticsStrings(), BasicStatisticsNumbers(), NearestNeighbourAnalysis(),
MeanCoords(), LinesIntersection(), UniqueValues(), PointDistance(),
# data management
ReprojectLayer(),
# geometry
ExportGeometryInfo(), Centroids(), Delaunay(), VoronoiPolygons(),
SimplifyGeometries(), DensifyGeometries(), DensifyGeometriesInterval(),
MultipartToSingleparts(), SinglePartsToMultiparts(), PolygonsToLines(),
LinesToPolygons(), ExtractNodes(),
# geoprocessing
ConvexHull(), FixedDistanceBuffer(), VariableDistanceBuffer(),
Dissolve(), Difference(), Intersection(), Union(), Clip(),
# research
ExtentFromLayer(), RandomSelection(), RandomSelectionWithinSubsets(),
SelectByLocation(),
#MMQGISX
mmqgisx_attribute_export_algorithm(),
mmqgisx_attribute_join_algorithm(),
mmqgisx_delete_columns_algorithm(),
mmqgisx_delete_duplicate_geometries_algorithm(),
mmqgisx_geocode_google_algorithm(),
mmqgisx_geometry_convert_algorithm(),
mmqgisx_geometry_export_algorithm(),
#mmqgisx_geometry_import_algorithm(),
mmqgisx_grid_algorithm(),
mmqgisx_gridify_algorithm(),
mmqgisx_hub_distance_algorithm(),
mmqgisx_hub_lines_algorithm(),
mmqgisx_label_point_algorithm(),
mmqgisx_merge_algorithm(),
mmqgisx_select_algorithm(),
mmqgisx_sort_algorithm(),
mmqgisx_text_to_float_algorithm()]

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


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


def getName(self):
return "qgis"

def getDescription(self):
return "QGIS geoalgorithms"

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

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

def supportsNonFileBasedOutput(self):
return True
@@ -58,16 +58,18 @@ def defineCharacteristics(self):
self.name = "Create new layer with selected features"

#the branch of the toolbox under which the algorithm will appear
self.group = "Algorithms for vector layers"
self.group = "Vector general tools"

#we add the input vector layer. It can have any kind of geometry
#It is a mandatory (not optional) one, hence the False argument
self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", ParameterVector.VECTOR_TYPE_ANY, False))
# we add a vector layer as output
self.addOutput(OutputVector(self.OUTPUT_LAYER, "Output layer with selected features"))

def getIcon(self):
return QIcon(os.path.dirname(__file__) + "/../images/toolbox.png")
#===========================================================================
# def getIcon(self):
# return QIcon(os.path.dirname(__file__) + "/../images/qgis.png")
#===========================================================================

def processAlgorithm(self, progress):
'''Here is where the processing itself takes place'''
Loading

0 comments on commit 79947fe

Please sign in to comment.