Skip to content

Commit 77786f3

Browse files
committed
[processing][SAGA] Fix interpolation choices for add grid values algorithms
And add more tests Fixes #19132
1 parent 4444428 commit 77786f3

14 files changed

+53
-3
lines changed

python/plugins/processing/algs/saga/description/AddGridValuestoPoints.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ Add Grid Values to Points
22
shapes_grid
33
QgsProcessingParameterFeatureSource|SHAPES|Points|0|None|False
44
QgsProcessingParameterMultipleLayers|GRIDS|Grids|3|None|False
5-
QgsProcessingParameterEnum|RESAMPLING|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation
5+
QgsProcessingParameterEnum|RESAMPLING|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Bicubic Spline Interpolation;[3] B-Spline Interpolation
66
QgsProcessingParameterVectorDestination|RESULT|Result
77
AllowUnmatching

python/plugins/processing/algs/saga/description/AddGridValuestoShapes.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ Add Grid Values to Shapes
22
shapes_grid
33
QgsProcessingParameterFeatureSource|SHAPES|Shapes|-1|None|False
44
QgsProcessingParameterMultipleLayers|GRIDS|Grids|3|None|False
5-
QgsProcessingParameterEnum|RESAMPLING|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Inverse Distance Interpolation;[3] Bicubic Spline Interpolation;[4] B-Spline Interpolation
5+
QgsProcessingParameterEnum|RESAMPLING|Interpolation|[0] Nearest Neighbor;[1] Bilinear Interpolation;[2] Bicubic Spline Interpolation;[3] B-Spline Interpolation
66
QgsProcessingParameterVectorDestination|RESULT|Result
77
AllowUnmatching
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UTF-8
Binary file not shown.
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]]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<SAGA_METADATA>
3+
<HISTORY saga-version="2.3.1">
4+
<MODULE library="shapes_grid" id="1" name="Add Grid Values to Shapes">
5+
<OPTION type="choice" id="RESAMPLING" name="Resampling" index="0">Nearest Neighbour</OPTION>
6+
<INPUT type="shapes" id="SHAPES" name="Shapes">
7+
<FILE>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/lines_over.shp</FILE>
8+
</INPUT>
9+
<INPUT_LIST type="grid_list" id="GRIDS" name="Grids">
10+
<dem type="grid_list" id="GRIDS" name="Grids">
11+
<FILE>/tmp/processing_f0fd76cf1e1e4c69bab137429bd6084c/a59bb63955554f778856866bbe0bca17/dem.sgrd</FILE>
12+
</dem>
13+
</INPUT_LIST>
14+
<OUTPUT type="shapes" id="RESULT" name="Result">lines_over</OUTPUT>
15+
</MODULE>
16+
</HISTORY>
17+
<SOURCE>
18+
<FILE></FILE>
19+
<DATABASE>
20+
<FIELDS>
21+
<FIELD TYPE="LONGINT">id</FIELD>
22+
<FIELD TYPE="STRING">name</FIELD>
23+
<FIELD TYPE="DOUBLE">dem</FIELD>
24+
</FIELDS>
25+
</DATABASE>
26+
<PROJECTION></PROJECTION>
27+
</SOURCE>
28+
<DESCRIPTION></DESCRIPTION>
29+
</SAGA_METADATA>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Binary file not shown.
Binary file not shown.

python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ tests:
4646
name: expected/saga/add_grid_to_points.shp
4747
type: vector
4848

49+
- algorithm: saga:addrastervaluestofeatures
50+
name: Add raster values to shapes
51+
params:
52+
GRIDS:
53+
params:
54+
- name: dem.tif
55+
type: raster
56+
type: multi
57+
RESAMPLING: 0
58+
SHAPES:
59+
name: custom/lines_over.shp
60+
type: vector
61+
results:
62+
RESULT:
63+
name: expected/saga/add_grid_to_shapes.shp
64+
type: vector
65+
4966
- algorithm: saga:mergevectorlayers
5067
name: Merge vector layers
5168
params:
@@ -237,4 +254,4 @@ tests:
237254
VARIANCE:
238255
hash: ec7b708609178533ac2b89cd575140415ef93c70396fa630d1c15b67
239256
type: rasterhash
240-
257+

0 commit comments

Comments
 (0)