Skip to content

Commit

Permalink
[processing][saga] Unit tests for snap points to lines/points algs
Browse files Browse the repository at this point in the history
(cherry-picked from 82364e4)
  • Loading branch information
nyalldawson committed Jul 12, 2018
1 parent 7097093 commit 9dcb413
Show file tree
Hide file tree
Showing 21 changed files with 156 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="shapes_points" id="19" name="Snap Points to Lines">
<OPTION type="double" id="DISTANCE" name="Search Distance">0.900000</OPTION>
<INPUT type="shapes" id="INPUT" name="Points">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/baab8e35e8b74d61b9e1be06b6303d5a/INPUT.shp</FILE>
</INPUT>
<INPUT type="shapes" id="SNAP" name="Snap Features">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/a58de6cbffc24234b5483d6a4ce9e5e7/SNAP.shp</FILE>
</INPUT>
<OUTPUT type="shapes" id="MOVES" name="Moves">INPUT [snap move: SNAP]</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE></FILE>
<DATABASE>
<FIELDS>
<FIELD TYPE="STRING">fid</FIELD>
</FIELDS>
</DATABASE>
<PROJECTION>
<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>
<PROJ4>+proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
<EPSG>-1</EPSG>
</PROJECTION>
</SOURCE>
<DESCRIPTION></DESCRIPTION>
</SAGA_METADATA>
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="shapes_points" id="19" name="Snap Points to Lines">
<OPTION type="double" id="DISTANCE" name="Search Distance">0.900000</OPTION>
<INPUT type="shapes" id="INPUT" name="Points">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/baab8e35e8b74d61b9e1be06b6303d5a/INPUT.shp</FILE>
</INPUT>
<INPUT type="shapes" id="SNAP" name="Snap Features">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/a58de6cbffc24234b5483d6a4ce9e5e7/SNAP.shp</FILE>
</INPUT>
<OUTPUT type="shapes" id="OUTPUT" name="Result">INPUT [snapped: SNAP]</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE></FILE>
<DATABASE>
<FIELDS>
<FIELD TYPE="STRING">fid</FIELD>
</FIELDS>
</DATABASE>
<PROJECTION>
<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>
<PROJ4>+proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
<EPSG>-1</EPSG>
</PROJECTION>
</SOURCE>
<DESCRIPTION></DESCRIPTION>
</SAGA_METADATA>
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="shapes_points" id="18" name="Snap Points to Points">
<OPTION type="double" id="DISTANCE" name="Search Distance">0.500000</OPTION>
<INPUT type="shapes" id="INPUT" name="Points">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/cc15847f946f404fbb7fb8baafffe3c7/INPUT.shp</FILE>
</INPUT>
<INPUT type="shapes" id="SNAP" name="Snap Features">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/e8d243d131f0456a86228224864db4fb/SNAP.shp</FILE>
</INPUT>
<OUTPUT type="shapes" id="MOVES" name="Moves">INPUT [snap move: SNAP]</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE></FILE>
<DATABASE>
<FIELDS>
<FIELD TYPE="STRING">fid</FIELD>
</FIELDS>
</DATABASE>
<PROJECTION>
<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>
<PROJ4>+proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
<EPSG>-1</EPSG>
</PROJECTION>
</SOURCE>
<DESCRIPTION></DESCRIPTION>
</SAGA_METADATA>
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<SAGA_METADATA>
<HISTORY saga-version="2.3.1">
<MODULE library="shapes_points" id="18" name="Snap Points to Points">
<OPTION type="double" id="DISTANCE" name="Search Distance">0.500000</OPTION>
<INPUT type="shapes" id="INPUT" name="Points">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/cc15847f946f404fbb7fb8baafffe3c7/INPUT.shp</FILE>
</INPUT>
<INPUT type="shapes" id="SNAP" name="Snap Features">
<FILE>/tmp/processing_c9cffa8a29a44a6381b1e4648d0e014a/e8d243d131f0456a86228224864db4fb/SNAP.shp</FILE>
</INPUT>
<OUTPUT type="shapes" id="OUTPUT" name="Result">INPUT [snapped: SNAP]</OUTPUT>
</MODULE>
</HISTORY>
<SOURCE>
<FILE></FILE>
<DATABASE>
<FIELDS>
<FIELD TYPE="STRING">fid</FIELD>
</FIELDS>
</DATABASE>
<PROJECTION>
<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>
<PROJ4>+proj=longlat +a=6378137.000000 +b=6356752.314245 +no_defs</PROJ4>
<EPSG>-1</EPSG>
</PROJECTION>
</SOURCE>
<DESCRIPTION></DESCRIPTION>
</SAGA_METADATA>
Original file line number Diff line number Diff line change
@@ -0,0 +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.
36 changes: 36 additions & 0 deletions python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,39 @@ tests:
name: expected/saga/cross_profiles.shp
type: vector

- algorithm: saga:snappointstolines
name: Snap points to lines
params:
DISTANCE: 0.9
INPUT:
name: snap_points.gml
type: vector
SNAP:
name: snap_lines.gml
type: vector
results:
MOVES:
name: expected/saga/snap_points_to_lines_moves.shp
type: vector
OUTPUT:
name: expected/saga/snap_points_to_lines_result.shp
type: vector

- algorithm: saga:snappointstopoints
name: Snap points to points
params:
DISTANCE: 0.5
INPUT:
name: snap_points.gml
type: vector
SNAP:
name: points.gml
type: vector
results:
MOVES:
name: expected/saga/snap_points_to_points_moves.shp
type: vector
OUTPUT:
name: expected/saga/snap_points_to_points_result.shp
type: vector

0 comments on commit 9dcb413

Please sign in to comment.