From dd9e46f86c05cac2ceb5c3123954dd493a0abee1 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 15 Jun 2018 11:24:38 +1000 Subject: [PATCH] [processing][saga] Remove duplicate intersect alg, add test --- .../algs/saga/description/Intersect.txt | 7 ++-- .../saga/description/PolygonIntersect.txt | 6 ---- .../expected/saga/polygon_intersect.dbf | Bin 0 -> 117 bytes .../expected/saga/polygon_intersect.mshp | 30 ++++++++++++++++++ .../expected/saga/polygon_intersect.prj | 1 + .../expected/saga/polygon_intersect.shp | Bin 0 -> 644 bytes .../expected/saga/polygon_intersect.shx | Bin 0 -> 132 bytes .../tests/testdata/saga_algorithm_tests.yaml | 15 +++++++++ 8 files changed, 50 insertions(+), 9 deletions(-) delete mode 100644 python/plugins/processing/algs/saga/description/PolygonIntersect.txt create mode 100644 python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.dbf create mode 100644 python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.mshp create mode 100644 python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.prj create mode 100644 python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.shp create mode 100644 python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.shx diff --git a/python/plugins/processing/algs/saga/description/Intersect.txt b/python/plugins/processing/algs/saga/description/Intersect.txt index bcce89cbc9c..08add635a22 100644 --- a/python/plugins/processing/algs/saga/description/Intersect.txt +++ b/python/plugins/processing/algs/saga/description/Intersect.txt @@ -1,6 +1,7 @@ Intersect shapes_polygons -QgsProcessingParameterFeatureSource|A|Layer A|-1|None|False -QgsProcessingParameterFeatureSource|B|Layer B|-1|None|False +QgsProcessingParameterFeatureSource|A|Layer A|2|None|False +QgsProcessingParameterFeatureSource|B|Layer B|2|None|False +QgsProcessingParameterBoolean|SPLIT|Split Parts|True QgsProcessingParameterVectorDestination|RESULT|Intersect -QgsProcessingParameterBoolean|SPLIT|Split Parts|True \ No newline at end of file + diff --git a/python/plugins/processing/algs/saga/description/PolygonIntersect.txt b/python/plugins/processing/algs/saga/description/PolygonIntersect.txt deleted file mode 100644 index 218e41dfe62..00000000000 --- a/python/plugins/processing/algs/saga/description/PolygonIntersect.txt +++ /dev/null @@ -1,6 +0,0 @@ -Intersect -shapes_polygons -QgsProcessingParameterFeatureSource|A|Layer A|2|None|False -QgsProcessingParameterFeatureSource|B|Layer B|2|None|False -QgsProcessingParameterBoolean|SPLIT|Split Parts|True -QgsProcessingParameterVectorDestination|RESULT|Intersection diff --git a/python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.dbf b/python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.dbf new file mode 100644 index 0000000000000000000000000000000000000000..1452a843686c61fb561db1cf993eda39453a5e7b GIT binary patch literal 117 zcmZQBW8-IGU|>jOU + + + + + + /tmp/processing_a4e6a4a6b82a483f8e8c419a452089a0/1f232bc285c34fdf88d633e407a0010e/A.shp + + + /tmp/processing_a4e6a4a6b82a483f8e8c419a452089a0/064f65665fa1433ea0fece6da36666df/B.shp + + Intersect [A]-[B] + + + + + + + id_a + id_b + + + + PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]] + + -1 + + + + diff --git a/python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.prj b/python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.prj new file mode 100644 index 00000000000..e375a0de156 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.prj @@ -0,0 +1 @@ +PROJCS["WGS 84 / Pseudo-Mercator",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"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]] \ No newline at end of file diff --git a/python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.shp b/python/plugins/processing/tests/testdata/expected/saga/polygon_intersect.shp new file mode 100644 index 0000000000000000000000000000000000000000..2e87d463c6ff88a8698afb0d5d81a63664d2ef3c GIT binary patch literal 644 zcmZ{gu@ZwY3`0#z?|MuO9T*t0^)s5||38G0PpIqoLF!8wP!vhFK;%71^BK1NF7i0F z<5P~WTrdSJx1IN(_qjhyeAbeG#>;2ZTw`zS0bksA&9b!aEok|ho~s_uT2pCu-s*uy zkC=ti1ApX}*FRhLSbZ;;oTtYBK*QTZd_A<>_}_zXVP^z0eO`N2LJ#7 literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml b/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml index 02ef2f896f5..daf52ed3a0c 100644 --- a/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml +++ b/python/plugins/processing/tests/testdata/saga_algorithm_tests.yaml @@ -331,3 +331,18 @@ tests: name: expected/saga/polygon_symmetrical_difference.shp type: vector + - algorithm: saga:intersect + name: Polygon intersect + params: + A: + name: custom/overlay1_a.geojson + type: vector + B: + name: custom/overlay1_b.geojson + type: vector + SPLIT: true + results: + RESULT: + name: expected/saga/polygon_intersect.shp + type: vector +