Skip to content
Permalink
Browse files

[processing] added grass7 files (forgot to add them on refactoring)

  • Loading branch information
volaya committed Apr 19, 2014
1 parent 5bb522e commit e142401c2b8dc0373d7c0aa467a7fb1cec0e18b6
Showing with 3,273 additions and 0 deletions.
  1. +8 −0 python/plugins/processing/algs/grass/description/r.cost.full.txt
  2. +8 −0 python/plugins/processing/algs/grass7/CMakeLists.txt
  3. +544 −0 python/plugins/processing/algs/grass7/Grass7Algorithm.py
  4. +107 −0 python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py
  5. +395 −0 python/plugins/processing/algs/grass7/Grass7Utils.py
  6. 0 python/plugins/processing/algs/grass7/__init__.py
  7. +15 −0 python/plugins/processing/algs/grass7/description/TODO.txt
  8. +15 −0 python/plugins/processing/algs/grass7/description/i.atcorr.txt
  9. +7 −0 python/plugins/processing/algs/grass7/description/i.fft.txt
  10. +10 −0 python/plugins/processing/algs/grass7/description/i.his.rgb.txt
  11. +7 −0 python/plugins/processing/algs/grass7/description/i.ifft.txt
  12. +9 −0 python/plugins/processing/algs/grass7/description/i.rgb.his.txt
  13. +9 −0 python/plugins/processing/algs/grass7/description/i.zc.txt
  14. +10 −0 python/plugins/processing/algs/grass7/description/m.cogo.txt
  15. +8 −0 python/plugins/processing/algs/grass7/description/nviz.txt
  16. +8 −0 python/plugins/processing/algs/grass7/description/r.aspect.txt
  17. +7 −0 python/plugins/processing/algs/grass7/description/r.average.txt
  18. +7 −0 python/plugins/processing/algs/grass7/description/r.basins.fill.txt
  19. +7 −0 python/plugins/processing/algs/grass7/description/r.bilinear.txt
  20. +7 −0 python/plugins/processing/algs/grass7/description/r.bitpattern.txt
  21. +8 −0 python/plugins/processing/algs/grass7/description/r.buffer.txt
  22. +10 −0 python/plugins/processing/algs/grass7/description/r.carve.txt
  23. +9 −0 python/plugins/processing/algs/grass7/description/r.circle.txt
  24. +6 −0 python/plugins/processing/algs/grass7/description/r.clump.txt
  25. +8 −0 python/plugins/processing/algs/grass7/description/r.coin.txt
  26. +12 −0 python/plugins/processing/algs/grass7/description/r.composite.txt
  27. +7 −0 python/plugins/processing/algs/grass7/description/r.contour.level.txt
  28. +9 −0 python/plugins/processing/algs/grass7/description/r.contour.step.txt
  29. +9 −0 python/plugins/processing/algs/grass7/description/r.cost.txt
  30. +6 −0 python/plugins/processing/algs/grass7/description/r.covar.txt
  31. +6 −0 python/plugins/processing/algs/grass7/description/r.cross.txt
  32. +11 −0 python/plugins/processing/algs/grass7/description/r.describe.txt
  33. +10 −0 python/plugins/processing/algs/grass7/description/r.drain.txt
  34. +8 −0 python/plugins/processing/algs/grass7/description/r.fill.dir.txt
  35. +7 −0 python/plugins/processing/algs/grass7/description/r.fillnulls.txt
  36. +14 −0 python/plugins/processing/algs/grass7/description/r.flow.txt
  37. +7 −0 python/plugins/processing/algs/grass7/description/r.grow.distance.txt
  38. +9 −0 python/plugins/processing/algs/grass7/description/r.grow.txt
  39. +25 −0 python/plugins/processing/algs/grass7/description/r.gwflow.txt
  40. +10 −0 python/plugins/processing/algs/grass7/description/r.his.txt
  41. +9 −0 python/plugins/processing/algs/grass7/description/r.horizon.height.txt
  42. +9 −0 python/plugins/processing/algs/grass7/description/r.horizon.txt
  43. +14 −0 python/plugins/processing/algs/grass7/description/r.info.txt
  44. +9 −0 python/plugins/processing/algs/grass7/description/r.kappa.txt
  45. +8 −0 python/plugins/processing/algs/grass7/description/r.lake.coords.txt
  46. +8 −0 python/plugins/processing/algs/grass7/description/r.lake.layer.txt
  47. +11 −0 python/plugins/processing/algs/grass7/description/r.mapcalculator.txt
  48. +6 −0 python/plugins/processing/algs/grass7/description/r.median.txt
  49. +8 −0 python/plugins/processing/algs/grass7/description/r.mfilter.fp.txt
  50. +8 −0 python/plugins/processing/algs/grass7/description/r.mfilter.txt
  51. +6 −0 python/plugins/processing/algs/grass7/description/r.mode.txt
  52. +10 −0 python/plugins/processing/algs/grass7/description/r.neighbors.txt
  53. +5 −0 python/plugins/processing/algs/grass7/description/r.out.gridatb.txt
  54. +6 −0 python/plugins/processing/algs/grass7/description/r.out.ppm.txt
  55. +7 −0 python/plugins/processing/algs/grass7/description/r.out.vrml.txt
  56. +12 −0 python/plugins/processing/algs/grass7/description/r.param.scale.txt
  57. +6 −0 python/plugins/processing/algs/grass7/description/r.patch.txt
  58. +10 −0 python/plugins/processing/algs/grass7/description/r.plane.txt
  59. +10 −0 python/plugins/processing/algs/grass7/description/r.profile.txt
  60. +9 −0 python/plugins/processing/algs/grass7/description/r.quant.txt
  61. +8 −0 python/plugins/processing/algs/grass7/description/r.quantile.txt
  62. +6 −0 python/plugins/processing/algs/grass7/description/r.random.cells.txt
  63. +6 −0 python/plugins/processing/algs/grass7/description/r.random.raster.txt
  64. +8 −0 python/plugins/processing/algs/grass7/description/r.random.txt
  65. +6 −0 python/plugins/processing/algs/grass7/description/r.reclass.area.greater.txt
  66. +6 −0 python/plugins/processing/algs/grass7/description/r.reclass.area.lesser.txt
  67. +6 −0 python/plugins/processing/algs/grass7/description/r.reclass.txt
  68. +7 −0 python/plugins/processing/algs/grass7/description/r.recode.txt
  69. +7 −0 python/plugins/processing/algs/grass7/description/r.regression.line.txt
  70. +13 −0 python/plugins/processing/algs/grass7/description/r.report.txt
  71. +7 −0 python/plugins/processing/algs/grass7/description/r.resamp.interp.txt
  72. +9 −0 python/plugins/processing/algs/grass7/description/r.resamp.rst.txt
  73. +9 −0 python/plugins/processing/algs/grass7/description/r.resamp.stats.txt
  74. +5 −0 python/plugins/processing/algs/grass7/description/r.resample.txt
  75. +7 −0 python/plugins/processing/algs/grass7/description/r.rescale.eq.txt
  76. +7 −0 python/plugins/processing/algs/grass7/description/r.rescale.txt
  77. +8 −0 python/plugins/processing/algs/grass7/description/r.series.txt
  78. +10 −0 python/plugins/processing/algs/grass7/description/r.shaded.relief.txt
  79. +21 −0 python/plugins/processing/algs/grass7/description/r.sim.sediment.txt
  80. +24 −0 python/plugins/processing/algs/grass7/description/r.sim.water.txt
  81. +17 −0 python/plugins/processing/algs/grass7/description/r.slope.aspect.txt
  82. +7 −0 python/plugins/processing/algs/grass7/description/r.spreadpath.txt
  83. +8 −0 python/plugins/processing/algs/grass7/description/r.statistics.txt
  84. +21 −0 python/plugins/processing/algs/grass7/description/r.stats.txt
  85. +13 −0 python/plugins/processing/algs/grass7/description/r.stream.angle.txt
  86. +10 −0 python/plugins/processing/algs/grass7/description/r.stream.basins.txt
  87. +8 −0 python/plugins/processing/algs/grass7/description/r.stream.del.txt
  88. +12 −0 python/plugins/processing/algs/grass7/description/r.stream.distance.txt
  89. +13 −0 python/plugins/processing/algs/grass7/description/r.stream.extract.txt
  90. +12 −0 python/plugins/processing/algs/grass7/description/r.stream.order.txt
  91. +9 −0 python/plugins/processing/algs/grass7/description/r.stream.pos.txt
  92. +7 −0 python/plugins/processing/algs/grass7/description/r.stream.stats.txt
  93. +4 −0 python/plugins/processing/algs/grass7/description/r.sum.txt
  94. +23 −0 python/plugins/processing/algs/grass7/description/r.sun.txt
  95. +17 −0 python/plugins/processing/algs/grass7/description/r.sunmask.txt
  96. +5 −0 python/plugins/processing/algs/grass7/description/r.surf.area.txt
  97. +5 −0 python/plugins/processing/algs/grass7/description/r.surf.contour.txt
  98. +6 −0 python/plugins/processing/algs/grass7/description/r.surf.gauss.txt
  99. +7 −0 python/plugins/processing/algs/grass7/description/r.surf.idw.txt
  100. +6 −0 python/plugins/processing/algs/grass7/description/r.surf.idw2.txt
  101. +7 −0 python/plugins/processing/algs/grass7/description/r.surf.random.txt
  102. +11 −0 python/plugins/processing/algs/grass7/description/r.terraflow.txt
  103. +6 −0 python/plugins/processing/algs/grass7/description/r.thin.txt
  104. +7 −0 python/plugins/processing/algs/grass7/description/r.to.vect.txt
  105. +5 −0 python/plugins/processing/algs/grass7/description/r.topidx.txt
  106. +9 −0 python/plugins/processing/algs/grass7/description/r.viewshed.txt
  107. +7 −0 python/plugins/processing/algs/grass7/description/r.volume.txt
  108. +16 −0 python/plugins/processing/algs/grass7/description/r.walk.txt
  109. +7 −0 python/plugins/processing/algs/grass7/description/r.water.outlet.txt
  110. +21 −0 python/plugins/processing/algs/grass7/description/r.watershed.txt
  111. +11 −0 python/plugins/processing/algs/grass7/description/v.buffer.column.txt
  112. +10 −0 python/plugins/processing/algs/grass7/description/v.buffer.distance.txt
  113. +11 −0 python/plugins/processing/algs/grass7/description/v.class.txt
  114. +8 −0 python/plugins/processing/algs/grass7/description/v.clean.advanced.txt
  115. +8 −0 python/plugins/processing/algs/grass7/description/v.clean.txt
  116. +16 −0 python/plugins/processing/algs/grass7/description/v.db.select.txt
  117. +7 −0 python/plugins/processing/algs/grass7/description/v.delaunay.txt
  118. +7 −0 python/plugins/processing/algs/grass7/description/v.dissolve.txt
  119. +10 −0 python/plugins/processing/algs/grass7/description/v.distance.toattr.txt
  120. +10 −0 python/plugins/processing/algs/grass7/description/v.distance.txt
  121. +11 −0 python/plugins/processing/algs/grass7/description/v.drape.txt
  122. +8 −0 python/plugins/processing/algs/grass7/description/v.extract.txt
  123. +19 −0 python/plugins/processing/algs/grass7/description/v.generalize.txt
  124. +7 −0 python/plugins/processing/algs/grass7/description/v.hull.txt
  125. +13 −0 python/plugins/processing/algs/grass7/description/v.in.dxf.txt
  126. +5 −0 python/plugins/processing/algs/grass7/description/v.in.wfs.txt
  127. +9 −0 python/plugins/processing/algs/grass7/description/v.info.txt
  128. +9 −0 python/plugins/processing/algs/grass7/description/v.kcv.txt
  129. +13 −0 python/plugins/processing/algs/grass7/description/v.lidar.correction.txt
  130. +14 −0 python/plugins/processing/algs/grass7/description/v.lidar.edgedetection.txt
  131. +9 −0 python/plugins/processing/algs/grass7/description/v.lidar.growing.txt
  132. +11 −0 python/plugins/processing/algs/grass7/description/v.mkgrid.txt
  133. +7 −0 python/plugins/processing/algs/grass7/description/v.neighbors.txt
  134. +10 −0 python/plugins/processing/algs/grass7/description/v.normal.txt
  135. +6 −0 python/plugins/processing/algs/grass7/description/v.out.dxf.txt
  136. +9 −0 python/plugins/processing/algs/grass7/description/v.out.pov.txt
  137. +12 −0 python/plugins/processing/algs/grass7/description/v.outlier.txt
  138. +9 −0 python/plugins/processing/algs/grass7/description/v.overlay.txt
  139. +13 −0 python/plugins/processing/algs/grass7/description/v.parallel.txt
  140. +8 −0 python/plugins/processing/algs/grass7/description/v.patch.txt
  141. +10 −0 python/plugins/processing/algs/grass7/description/v.perturb.txt
  142. +8 −0 python/plugins/processing/algs/grass7/description/v.qcount.txt
  143. +9 −0 python/plugins/processing/algs/grass7/description/v.random.txt
  144. +9 −0 python/plugins/processing/algs/grass7/description/v.reclass.txt
  145. +8 −0 python/plugins/processing/algs/grass7/description/v.report.txt
  146. +11 −0 python/plugins/processing/algs/grass7/description/v.sample.txt
  147. +7 −0 python/plugins/processing/algs/grass7/description/v.segment.txt
  148. +10 −0 python/plugins/processing/algs/grass7/description/v.select.txt
  149. +7 −0 python/plugins/processing/algs/grass7/description/v.split.length.txt
  150. +7 −0 python/plugins/processing/algs/grass7/description/v.split.vert.txt
  151. +12 −0 python/plugins/processing/algs/grass7/description/v.surf.bspline.lambda.txt
  152. +12 −0 python/plugins/processing/algs/grass7/description/v.surf.bspline.sparse.txt
  153. +11 −0 python/plugins/processing/algs/grass7/description/v.surf.bspline.txt
  154. +9 −0 python/plugins/processing/algs/grass7/description/v.surf.idw.txt
  155. +16 −0 python/plugins/processing/algs/grass7/description/v.surf.rst.cvdev.txt
  156. +23 −0 python/plugins/processing/algs/grass7/description/v.surf.rst.txt
  157. +8 −0 python/plugins/processing/algs/grass7/description/v.to.points.txt
  158. +7 −0 python/plugins/processing/algs/grass7/description/v.to.rast.attribute.txt
  159. +7 −0 python/plugins/processing/algs/grass7/description/v.to.rast.value.txt
  160. +7 −0 python/plugins/processing/algs/grass7/description/v.transform.pointsfile.txt
  161. +12 −0 python/plugins/processing/algs/grass7/description/v.transform.txt
  162. +11 −0 python/plugins/processing/algs/grass7/description/v.univar.txt
  163. +8 −0 python/plugins/processing/algs/grass7/description/v.voronoi.txt
  164. +3 −0 python/plugins/processing/algs/grass7/ext/CMakeLists.txt
  165. +40 −0 python/plugins/processing/algs/grass7/ext/HtmlReportPostProcessor.py
  166. 0 python/plugins/processing/algs/grass7/ext/__init__.py
  167. +32 −0 python/plugins/processing/algs/grass7/ext/r_coin.py
  168. +32 −0 python/plugins/processing/algs/grass7/ext/r_covar.py
  169. +32 −0 python/plugins/processing/algs/grass7/ext/r_describe.py
  170. +32 −0 python/plugins/processing/algs/grass7/ext/r_info.py
  171. +32 −0 python/plugins/processing/algs/grass7/ext/r_regression_line.py
  172. +32 −0 python/plugins/processing/algs/grass7/ext/r_report.py
  173. +32 −0 python/plugins/processing/algs/grass7/ext/r_stats.py
  174. +32 −0 python/plugins/processing/algs/grass7/ext/v_class.py
  175. +32 −0 python/plugins/processing/algs/grass7/ext/v_info.py
  176. +32 −0 python/plugins/processing/algs/grass7/ext/v_normal.py
  177. +32 −0 python/plugins/processing/algs/grass7/ext/v_report.py
  178. +32 −0 python/plugins/processing/algs/grass7/ext/v_univar.py
  179. +114 −0 python/plugins/processing/algs/grass7/grass7.txt
  180. +167 −0 python/plugins/processing/algs/grass7/nviz7.py
@@ -0,0 +1,8 @@
r.cost
r.cost.full - Creates a raster layer of cumulative cost of moving across a raster layer whose cell values represent cost.
Raster (r.*)
ParameterRaster|input|Unit cost layer|False
ParameterVector|start_points|Start points|0|False
ParameterBoolean|-k|Use the 'Knight's move'; slower, but more accurate|False
ParameterBoolean|-n|Keep null values in output raster layer|False
OutputRaster|output|Cumulative cost
@@ -0,0 +1,8 @@
FILE(GLOB PY_FILES *.py)
FILE(GLOB OTHER_FILES grass7.txt)
FILE(GLOB DESCR_FILES description/*.txt)

ADD_SUBDIRECTORY(ext)

PLUGIN_INSTALL(processing grass7 ${PY_FILES} ${OTHER_FILES})
PLUGIN_INSTALL(processing grass7/description ${DESCR_FILES})

Large diffs are not rendered by default.

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

"""
***************************************************************************
Grass7AlgorithmProvider.py
---------------------
Date : April 2014
Copyright : (C) 2014 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__ = 'April 2014'
__copyright__ = '(C) 2014, Victor Olaya'

# This will get replaced with a git SHA1 when you do a git archive

__revision__ = '$Format:%H$'

import os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from processing.core.ProcessingConfig import ProcessingConfig, Setting
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.core.ProcessingLog import ProcessingLog
from Grass7Utils import Grass7Utils
from Grass7Algorithm import Grass7Algorithm
from processing.tools.system import *
from nviz7 import nviz7

class Grass7AlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.createAlgsList() # Preloading algorithms to speed up

def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
if isWindows() or isMac():
ProcessingConfig.addSetting(Setting(self.getDescription(),
Grass7Utils.GRASS_FOLDER, 'GRASS7 folder',
Grass7Utils.grassPath()))
ProcessingConfig.addSetting(Setting(self.getDescription(),
Grass7Utils.GRASS_WIN_SHELL, 'Msys folder',
Grass7Utils.grassWinShell()))
ProcessingConfig.addSetting(Setting(self.getDescription(),
Grass7Utils.GRASS_LOG_COMMANDS,
'Log execution commands', False))
ProcessingConfig.addSetting(Setting(self.getDescription(),
Grass7Utils.GRASS_LOG_CONSOLE,
'Log console output', False))

def unload(self):
AlgorithmProvider.unload(self)
if isWindows() or isMac():
ProcessingConfig.removeSetting(Grass7Utils.GRASS_FOLDER)
ProcessingConfig.removeSetting(Grass7Utils.GRASS_WIN_SHELL)
ProcessingConfig.removeSetting(Grass7Utils.GRASS_LOG_COMMANDS)
ProcessingConfig.removeSetting(Grass7Utils.GRASS_LOG_CONSOLE)

def createAlgsList(self):
self.preloadedAlgs = []
folder = Grass7Utils.grassDescriptionPath()
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith('txt'):
try:
alg = Grass7Algorithm(os.path.join(folder, descriptionFile))
if alg.name.strip() != '':
self.preloadedAlgs.append(alg)
else:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not open GRASS GIS 7 algorithm: '
+ descriptionFile)
except Exception, e:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
'Could not open GRASS GIS 7 algorithm: '
+ descriptionFile)
self.preloadedAlgs.append(nviz7())

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

def getDescription(self):
return 'GRASS GIS 7 commands'

def getName(self):
return 'grass70'

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

def getSupportedOutputVectorLayerExtensions(self):
return ['shp']

def getSupportedOutputRasterLayerExtensions(self):
return ['tif']

0 comments on commit e142401

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