Skip to content

Commit a9646f1

Browse files
committedJul 25, 2018
[processing][grass] Fix generation of output for v.rast.stats, add test
(cherry-picked from a463af3)
1 parent 8ad59aa commit a9646f1

File tree

6 files changed

+37
-1
lines changed

6 files changed

+37
-1
lines changed
 

‎python/plugins/processing/algs/grass7/ext/v_rast_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ def processOutputs(alg, parameters, context, feedback):
3636
fileName = alg.parameterAsOutputLayer(parameters, 'output', context)
3737
grassName = alg.exportedLayers['map']
3838
dataType = 'auto'
39-
alg.exportVectorLayer(grassName, fileName, dataType)
39+
alg.exportVectorLayer(grassName, fileName, dataType=dataType)
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
Binary file not shown.
Binary file not shown.

‎python/plugins/processing/tests/testdata/grass7_algorithms_vector_tests.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,38 @@ tests:
3333
geometry:
3434
precision: 7
3535

36+
- algorithm: grass7:v.rast.stats
37+
name: V.rast.stats
38+
params:
39+
GRASS_MIN_AREA_PARAMETER: 0.0001
40+
GRASS_OUTPUT_TYPE_PARAMETER: 0
41+
GRASS_REGION_CELLSIZE_PARAMETER: 0.0
42+
GRASS_SNAP_TOLERANCE_PARAMETER: -1.0
43+
GRASS_VECTOR_DSCO: ''
44+
GRASS_VECTOR_LCO: ''
45+
column_prefix: s
46+
map:
47+
name: custom/zonal_stats.shp
48+
type: vector
49+
method:
50+
- 0
51+
- 1
52+
- 2
53+
- 3
54+
- 4
55+
- 5
56+
- 6
57+
- 7
58+
- 8
59+
- 9
60+
- 10
61+
- 11
62+
- 12
63+
percentile: 90
64+
raster:
65+
name: dem.tif
66+
type: raster
67+
results:
68+
output:
69+
name: expected/grass7/v_rast_stats.shp
70+
type: vector

0 commit comments

Comments
 (0)
Please sign in to comment.