Skip to content

Commit 5bd63c7

Browse files
committed
[processing][saga] Add unit test for point distances alg
(cherry picked from commit 4212dea)
1 parent 3272950 commit 5bd63c7

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<SAGA_METADATA>
3+
<HISTORY saga-version="2.3.1">
4+
<MODULE library="shapes_points" id="3" name="Point Distances">
5+
<OPTION type="table_field" id="ID_POINTS" name="Identifier" index="0">fid</OPTION>
6+
<OPTION type="choice" id="FORMAT" name="Output Format" index="1">each pair with a single record</OPTION>
7+
<OPTION type="double" id="MAX_DIST" name="Maximum Distance">0.000000</OPTION>
8+
<INPUT type="shapes" id="POINTS" name="Points">
9+
<FILE>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</FILE>
10+
</INPUT>
11+
<OUTPUT type="table" id="DISTANCES" name="Distances">Distances [points]</OUTPUT>
12+
</MODULE>
13+
</HISTORY>
14+
<SOURCE>
15+
<FILE>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/expected/saga/point_distances.dbf</FILE>
16+
<DATABASE>
17+
<FIELDS>
18+
<FIELD TYPE="STRING">ID_POINT</FIELD>
19+
<FIELD TYPE="STRING">ID_NEAR</FIELD>
20+
<FIELD TYPE="DOUBLE">DISTANCE</FIELD>
21+
</FIELDS>
22+
</DATABASE>
23+
<PROJECTION>
24+
<OGC_WKT>GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]</OGC_WKT>
25+
<PROJ4>+proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
26+
<EPSG>-1</EPSG>
27+
</PROJECTION>
28+
</SOURCE>
29+
<DESCRIPTION></DESCRIPTION>
30+
</SAGA_METADATA>
Lines changed: 1 addition & 0 deletions
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"]]

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,3 +486,17 @@ tests:
486486
hash: 6f81c858fc7575eaff6258b6e75bf4427d0568d5134837523b730929
487487
type: rasterhash
488488

489+
- algorithm: saga:pointdistances
490+
name: Point distances
491+
params:
492+
FORMAT: 1
493+
ID_POINTS: fid
494+
MAX_DIST: 0.0
495+
POINTS:
496+
name: custom/points.shp
497+
type: vector
498+
results:
499+
DISTANCES:
500+
name: expected/saga/point_distances.dbf
501+
type: vector
502+

0 commit comments

Comments
 (0)