Skip to content

Commit a1a66a8

Browse files
committedJan 24, 2017
[processing] use point parameter in GRASS algs where possible (addresses #15983)
(cherry picked from commit 5dc39e0)
1 parent 75711a8 commit a1a66a8

File tree

11 files changed

+25
-12
lines changed

11 files changed

+25
-12
lines changed
 

‎python/plugins/processing/algs/grass7/description/m.cogo.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
m.cogo
2-
A simple utility for converting bearing and distance measurements to coordinates and vice versa. It assumes a cartesian coordinate system
2+
A simple utility for converting bearing and distance measurements to coordinates and vice versa. It assumes a cartesian coordinate system
33
Miscellaneous (m.*)
44
ParameterFile|input|Name of input file|False
55
OutputFile|output|Output text file
6-
ParameterString|coordinates|Starting coordinate pair (default 0.0, 0.0)|0.0,0.0
6+
ParameterPoint|coordinates|Starting coordinate pair|0.0,0.0
77
*ParameterBoolean|-l|Lines are labelled|False
88
*ParameterBoolean|-q|Suppress warnings|False
99
*ParameterBoolean|-r|Convert from coordinates to bearing and distance|False

‎python/plugins/processing/algs/grass7/description/r.circle.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
r.circle
22
Creates a raster map containing concentric rings around a given point.
33
Raster (r.*)
4-
ParameterString|coordinates|The coordinate of the center (east,north)|0,0
4+
ParameterPoint|coordinates|The coordinate of the center (east,north)|0,0
55
ParameterNumber|min|Minimum radius for ring/circle map (in meters)|None|None|10
66
ParameterNumber|max|Maximum radius for ring/circle map (in meters)|None|None|20
77
ParameterString|multiplier|Data value multiplier|1

‎python/plugins/processing/algs/grass7/description/r.cost.coordinates.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ r.cost
22
r.cost.coordinates - Creates a raster layer of cumulative cost of moving across a raster layer whose cell values represent cost.
33
Raster (r.*)
44
ParameterRaster|input|Unit cost layer|False
5-
ParameterString|start_coordinates|Coordinates of starting point(s) (E,N)|0,0
6-
ParameterString|stop_coordinates|Coordinates of stopping point(s) (E,N)|
5+
ParameterPoint|start_coordinates|Coordinates of starting point(s) (E,N)|0,0
6+
ParameterPoint|stop_coordinates|Coordinates of stopping point(s) (E,N)|0,0
77
ParameterBoolean|-k|Use the 'Knight's move'; slower, but more accurate|False
88
ParameterBoolean|-n|Keep null values in output raster layer|True
99
ParameterNumber|max_cost|Maximum cumulative cost|0|None|0

‎python/plugins/processing/algs/grass7/description/r.drain.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Traces a flow through an elevation model on a raster map.
33
Raster (r.*)
44
ParameterRaster|input|Elevation|False
55
ParameterRaster|direction|Name of input movement direction map associated with the cost surface|True
6-
ParameterString|start_coordinates|Map coordinates of starting point(s) (E,N)|0.0,0.0|False|True
6+
ParameterPoint|start_coordinates|Map coordinates of starting point(s) (E,N)|0.0,0.0|True
77
ParameterVector|start_points|Vector layer containing starting point(s)|0|True
88
ParameterBoolean|-c|Copy input cell values on output|False
99
ParameterBoolean|-a|Accumulate input values along the path|False

‎python/plugins/processing/algs/grass7/description/r.horizon.height.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ r.horizon
22
r.horizon.height - Horizon angle computation from a digital elevation model.
33
Raster (r.*)
44
ParameterRaster|elevation|Name of input elevation raster map|False
5-
ParameterString|coordinates|Coordinate for which you want to calculate the horizon|0,0
5+
ParameterPoint|coordinates|Coordinate for which you want to calculate the horizon|0,0
66
ParameterNumber|direction|Direction in which you want to calculate the horizon height|0|360|0.0
77
ParameterNumber|step|Angle step size for multidirectional horizon [degrees]|0|360|0.0
88
ParameterNumber|start|Start angle for multidirectional horizon [degrees]|0|360|0
99
ParameterNumber|end|End angle for multidirectional horizon [degrees]|0|360|360
1010
ParameterNumber|maxdistance|The maximum distance to consider when finding the horizon height|0|None|10000
1111
ParameterString|distance|Sampling distance step coefficient (0.5-1.5)|1.0
1212
ParameterBoolean|-d|Write output in degrees (default is radians)|False
13-
OutputHTML|html|Horizon
13+
OutputHTML|html|Horizon

‎python/plugins/processing/algs/grass7/description/r.lake.coords.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ r.lake.coords - Fills lake at given point to given level.
33
Raster (r.*)
44
ParameterRaster|elevation|Elevation|False
55
ParameterNumber|water_level|Water level|None|None|1000.0
6-
ParameterString|coordinates|Seed point coordinates|0,0
6+
ParameterPoint|coordinates|Seed point coordinates|0,0
77
ParameterBoolean|-n|Use negative depth values for lake raster layer|False
88
OutputRaster|lake|Lake

‎python/plugins/processing/algs/grass7/description/r.spreadpath.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Recursively traces the least cost path backwards to cells from which the cumulat
33
Raster (r.*)
44
ParameterRaster|x_input|x_input|False
55
ParameterRaster|y_input|y_input|False
6-
ParameterString|coordinates|coordinate|0,0
6+
ParameterPoint|coordinates|coordinate|0,0
77
OutputRaster|output|Backward least cost

‎python/plugins/processing/algs/grass7/description/r.viewshed.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ r.viewshed
22
Computes the viewshed of a point on an elevation raster map.
33
Raster (r.*)
44
ParameterRaster|input|Elevation|False
5-
ParameterString|coordinates|Coordinate identifying the viewing position|0,0|False|False
5+
ParameterPoint|coordinates|Coordinate identifying the viewing position|0.0,0.0
66
ParameterString|observer_elevation|Viewing elevation above the ground|1.75|False|False
77
ParameterString|target_elevation|Offset for target elevation above the ground|0.0|False|False
88
ParameterString|max_distance|Maximum distance from the viewing point (meters)|-1|False|False

‎python/plugins/processing/algs/grass7/description/r.what.coords.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ r.what
22
r.what.coords - Queries raster maps on their category values and category labels on a point.
33
Raster (r.*)
44
ParameterRaster|map|Name of raster map|False
5-
ParameterString|coordinates|Coordinates for query (east, north)|None|False|False
5+
ParameterPoint|coordinates|Coordinates for query (east, north)
66
ParameterString|null_value|String representing NULL value|*|False|True
77
ParameterString|separator|Field separator. Special characters: pipe, comma, space, tab, newlineString representing NULL value|pipe|False|True
88
ParameterNumber|cache|Size of point cache|0|None|500|True

‎python/plugins/processing/algs/taudem/TauDEMUtils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def taudemDescriptionPath():
102102
def executeTauDEM(command, progress):
103103
loglines = []
104104
loglines.append(TauDEMUtils.tr('TauDEM execution console output'))
105+
command = escapeAndJoin(command)
105106
fused_command = ''.join(['"%s" ' % c for c in command])
106107
progress.setInfo(TauDEMUtils.tr('TauDEM command:'))
107108
progress.setCommand(fused_command.replace('" "', ' ').strip('"'))

‎python/plugins/processing/tools/system.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,15 @@ def mkdir(newdir):
136136
mkdir(head)
137137
if tail:
138138
os.mkdir(newdir)
139+
140+
141+
def escapeAndJoin(strList):
142+
joined = ''
143+
for s in strList:
144+
if s[0] != '-' and ' ' in s:
145+
escaped = '"' + s.replace('\\', '\\\\').replace('"', '\\"') \
146+
+ '"'
147+
else:
148+
escaped = s
149+
joined += escaped + ' '
150+
return joined.strip()

0 commit comments

Comments
 (0)
Please sign in to comment.