From baf50af3cdcb2ba0dbcf52492f9072c53c9d9b4f Mon Sep 17 00:00:00 2001 From: Clemens Raffler Date: Sun, 24 Oct 2021 15:23:29 +0200 Subject: [PATCH] add more testcases with differing layer CRSs --- .../tests/testdata/custom/polys_epsg31256.cpg | 1 + .../tests/testdata/custom/polys_epsg31256.dbf | Bin 0 -> 99 bytes .../tests/testdata/custom/polys_epsg31256.prj | 1 + .../tests/testdata/custom/polys_epsg31256.shp | Bin 0 -> 636 bytes .../tests/testdata/custom/polys_epsg31256.shx | Bin 0 -> 124 bytes ...rtest_line_point_to_lineCentroid_3857.dbf} | Bin 3120 -> 3120 bytes ...rtest_line_point_to_lineCentroid_3857.prj} | 0 ...rtest_line_point_to_lineCentroid_3857.shp} | Bin ...rtest_line_point_to_lineCentroid_3857.shx} | Bin ...f => shortest_line_point_to_line_3857.dbf} | Bin 3120 -> 3120 bytes ...j => shortest_line_point_to_line_3857.prj} | 0 ...p => shortest_line_point_to_line_3857.shp} | Bin ...x => shortest_line_point_to_line_3857.shx} | Bin ...ortest_line_point_to_line_4326_to_3857.dbf | Bin 0 -> 5171 bytes ...ortest_line_point_to_line_4326_to_3857.prj | 1 + ...ortest_line_point_to_line_4326_to_3857.shp | Bin 0 -> 892 bytes ...ortest_line_point_to_line_4326_to_3857.shx | Bin 0 -> 172 bytes ...st_line_point_to_polygon_4326_to_31256.dbf | Bin 0 -> 2975 bytes ...st_line_point_to_polygon_4326_to_31256.prj | 1 + ...st_line_point_to_polygon_4326_to_31256.shp | Bin 0 -> 892 bytes ...st_line_point_to_polygon_4326_to_31256.shx | Bin 0 -> 172 bytes .../tests/testdata/qgis_algorithm_tests4.yaml | 42 +++++++++++++++--- 22 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 python/plugins/processing/tests/testdata/custom/polys_epsg31256.cpg create mode 100644 python/plugins/processing/tests/testdata/custom/polys_epsg31256.dbf create mode 100644 python/plugins/processing/tests/testdata/custom/polys_epsg31256.prj create mode 100644 python/plugins/processing/tests/testdata/custom/polys_epsg31256.shp create mode 100644 python/plugins/processing/tests/testdata/custom/polys_epsg31256.shx rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_lineCentroid.dbf => shortest_line_point_to_lineCentroid_3857.dbf} (75%) rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_line.prj => shortest_line_point_to_lineCentroid_3857.prj} (100%) rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_lineCentroid.shp => shortest_line_point_to_lineCentroid_3857.shp} (100%) rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_lineCentroid.shx => shortest_line_point_to_lineCentroid_3857.shx} (100%) rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_line.dbf => shortest_line_point_to_line_3857.dbf} (78%) rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_lineCentroid.prj => shortest_line_point_to_line_3857.prj} (100%) rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_line.shp => shortest_line_point_to_line_3857.shp} (100%) rename python/plugins/processing/tests/testdata/expected/{shortest_line_point_to_line.shx => shortest_line_point_to_line_3857.shx} (100%) create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.dbf create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.prj create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.shp create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.shx create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_polygon_4326_to_31256.dbf create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_polygon_4326_to_31256.prj create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_polygon_4326_to_31256.shp create mode 100644 python/plugins/processing/tests/testdata/expected/shortest_line_point_to_polygon_4326_to_31256.shx diff --git a/python/plugins/processing/tests/testdata/custom/polys_epsg31256.cpg b/python/plugins/processing/tests/testdata/custom/polys_epsg31256.cpg new file mode 100644 index 00000000000..3ad133c048f --- /dev/null +++ b/python/plugins/processing/tests/testdata/custom/polys_epsg31256.cpg @@ -0,0 +1 @@ +UTF-8 \ No newline at end of file diff --git a/python/plugins/processing/tests/testdata/custom/polys_epsg31256.dbf b/python/plugins/processing/tests/testdata/custom/polys_epsg31256.dbf new file mode 100644 index 0000000000000000000000000000000000000000..3a3a7236d824d48162bac5c9cc60314901166ec0 GIT binary patch literal 99 ycmZRs z>~2^qb2j*(&@4|c6-&*7@;we4q?Hlj&wrxh09RqiL791r z{_S64d~o`j;`1k4Lk@nJbZ4<$DZ;Jj?g4rS7_$rxAb(xu^%Fg+-<OdfeU9_BWp$S|qOmEhPjLEwCK?h%ptlRKE1fdsZ)~&+bmp0l3 I9Yog;0JLKCS^xk5 literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/custom/polys_epsg31256.shx b/python/plugins/processing/tests/testdata/custom/polys_epsg31256.shx new file mode 100644 index 0000000000000000000000000000000000000000..99bd05859677ddfc7ba193fc224a5473aae5779e GIT binary patch literal 124 zcmZQzQ0HR64(whqGcd3MQ1c9RNg^6oUW& literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.dbf b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.dbf similarity index 75% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.dbf rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.dbf index 885f725cce4f406dc5b4b96b684ed8cb8f05e59b..7155138eb241629c703bd97cb10d4c69ecd7d41c 100644 GIT binary patch delta 288 zcmW-c%S}T;3`I4(;lBd%q9=+N`9JoOe$qgeDFL#ejiA>6qMax`;K{}dAKl~Y({fts zw0~ND>aom@0NT2kgo9}GPN1KM&H7tvc_EiZ3J7ef)RDgGc0J$J@+NF86BLf-20grw z)V5A#BOcU{lz{_5KmuaGkK3udnu<1};0WU$8Zw-_yPAlip@RW>IxUMFOP$y6`{87v zrf7_8guM%+4d>rOmdP_M#N4yyK%!T6c}$kee2>VDBZmfG-&>xiG6yg;PhWOHkznuo F{tsb8KfnM0 delta 292 zcmW;I$xQ@733_R?+D_ZL zyxiP{KE_OxS}@=Y^b1iC|$0s(|* wj)^~4Ggzf#46mPFTo)&Kwi diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.prj b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.prj similarity index 100% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.prj rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.prj diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.shp b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.shp similarity index 100% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.shp rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.shp diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.shx b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.shx similarity index 100% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.shx rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid_3857.shx diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.dbf b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.dbf similarity index 78% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.dbf rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.dbf index 3b7690673e811673e9ff9cc4ff804352ea26e5e3..8aeb709612a529c767e941a8ff7327003d6dfd23 100644 GIT binary patch delta 292 zcmW-b$xQ=65JlBYvzZ%=tr0=AYG01zLjoKL!2*dijGO=>9poISnZrN5znzxT(xc3zpIre7))IQ9%coLmC)pS^T5*{rT&*a-lg4m4zJY zYZVc^?Dt=+*golkTjjlMJSka8(bcywoh;wz`>qXOyG&}{0|mS BL3scG delta 292 zcmW-c%S{7O3`O;r2L!T%2^vv^<ph->ZU_5+F(`Ho|k5X|C|8 z7aZ;h!R$#~K@N}Y?8|j;kAn@?6%!&QX@;!9*PCLb49+#?F$C+K&G>m+Ov8Y@l!zFX zD!Ao-b|s8t0`q#OiV&*=Zo7qGO2KL>>Q-S^fBpv> CJ3%G@ diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.prj b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.prj similarity index 100% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_lineCentroid.prj rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.prj diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.shp b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.shp similarity index 100% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.shp rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.shp diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.shx b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.shx similarity index 100% rename from python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line.shx rename to python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_3857.shx diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.dbf b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.dbf new file mode 100644 index 0000000000000000000000000000000000000000..3e18a048f35000b72ebe9f66509e7946dd70c1f7 GIT binary patch literal 5171 zcmeI0u};J=42CP1I0>94AiVnVnZah&!Z8s37$g9*-A8xR5wH-MxXEC9cz2 z@~6MH+v~5*_GTD{@8RJ}wzKs%?wjv%F@D-r-TU$Iw752B=h!?K&n5nIz2jp1{Wu?A zrq_c6`FnnQ*TVhpx4X}eaXQWpcD9$-^znV14zojbm^8q#Cq_s}Oqn?~p>$9tx$L?w z{3;ZYfOn7+LBIeQD5uoMMo zrJ{Hbm>5#_92lBVIw&P(${@{lZ9NML5lUf1j35I_NfDb+Iw&P(%1D}RZ9T?IEIK|} zp$VmfQeviztl3tf7=LqQMxi8wtPHd+T>se}R~dWl+5 WIw&P(%3#g53dQ*U0&sA$%Ka}#h^a{c literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.prj b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.prj new file mode 100644 index 00000000000..f45cbadf007 --- /dev/null +++ b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.prj @@ -0,0 +1 @@ +GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.shp b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.shp new file mode 100644 index 0000000000000000000000000000000000000000..a40f244a571a17acb001cb43d7fcaf908133cb2d GIT binary patch literal 892 zcmZQzQ0HR63K;jjU}j(dA~Ya!fNS~F`BF{_4iE_rD2=8JmCFd^Y9P$|U=NZ0V9)b# zUupR4fA(xw)jw(Kf3ycFWJ1x4TP;*6*xa-`e(`>nSsf&L4sL1-{SP%C<~9xoOmh)( zSoDINisW7f2dI-A&UOpRS;;Usy!I*IaP%Dm7ISf{1)9NvYOV;}+^+#uO0{>y9eQtW z|KFC*gvDIkYJq05!pwF25OqV>f(vRcEbIgv^s@}Ra=HFu310!YT9{s#TA-P1Fmr)4 z5)e7?@jnQ#J3s_Q4q%2aOgW}npbR?@BZaSmgYX&t`8P8@?ng~qANFIK3rlw&;A&xd zfo5``nk(aQI4tn0ft!0&S0LlXaHgjbhz*0atm|B=#pg1QGBe|D>K?SV% S!+wY!7>UhXgdB_o(+dE|!j~BU literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.shx b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_line_4326_to_3857.shx new file mode 100644 index 0000000000000000000000000000000000000000..4a6bf1a22bd64a53bf9d7a3ac64f320cc65dba4f GIT binary patch literal 172 zcmZQzQ0HR64#HkAGcW)V8W1_awfyOPDJKO7hy(|eMpK5$H3D)qfH)3HcR}fGQ2G&s QX5@p?R!}+(N>2jO0B~9g;Q#;t literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_polygon_4326_to_31256.dbf b/python/plugins/processing/tests/testdata/expected/shortest_line_point_to_polygon_4326_to_31256.dbf new file mode 100644 index 0000000000000000000000000000000000000000..21f3fefb7dc046439c6f55df2c578e4b3e836d4f GIT binary patch literal 2975 zcmd^>K~BRk5JiJnQ3Lwui0~l(iW+kf@n4zkBcFk5|5=gH*hxo0Y+`&5?uA0Kz0ALq+>b+GIEL9q}+CLT=A z0v!QK4or{~JZK56LQABN+M7*S2~7h9uYfEVJVObsLPmEb*xXVR8aNgr&=AlQMoA^K z3K`v%2VutJ!Qr zn|2xkDg;U)|3j(lv_a>trd-cC3 zf0iElY7f!(!5*ZL3B`~Pa5Ut1=2tu-~gr=KG-W<3lB4q6m&R{6|(4g>n|+fi(4(w3^pJ}4hM*_3?c`7 zE|}KtP8D>>zMyLMYBm1>O!q>SVo?i}VTYM}Y+jv3*#db7zR!|RRNQ~>hvT=2!oxut0mU_dI1Wm8LFsK!`VoX?y LP&y4tPXf^ZLQ@D( literal 0 HcmV?d00001 diff --git a/python/plugins/processing/tests/testdata/qgis_algorithm_tests4.yaml b/python/plugins/processing/tests/testdata/qgis_algorithm_tests4.yaml index 15240453415..bc9fe83cbf3 100644 --- a/python/plugins/processing/tests/testdata/qgis_algorithm_tests4.yaml +++ b/python/plugins/processing/tests/testdata/qgis_algorithm_tests4.yaml @@ -2786,8 +2786,7 @@ tests: type: vector - algorithm: native:shortestline - name: Test (native:shortestline) - ellipsoid: EPSG:7030 + name: Test native:shortestline using centroid destination and matching CRSs project_crs: EPSG:3857 params: DESTINATION: @@ -2800,12 +2799,11 @@ tests: type: vector results: OUTPUT: - name: expected/shortest_line_point_to_lineCentroid.shp + name: expected/shortest_line_point_to_lineCentroid_3857.shp type: vector - algorithm: native:shortestline - name: Test (native:shortestline) - ellipsoid: EPSG:7030 + name: Test native:shortestline using nearest point on line geometry destination and matching CRSs project_crs: EPSG:3857 params: DESTINATION: @@ -2818,7 +2816,39 @@ tests: type: vector results: OUTPUT: - name: expected/shortest_line_point_to_line.shp + name: expected/shortest_line_point_to_line_3857.shp + type: vector + + - algorithm: native:shortestline + name: Test native:shortestline using nearest point on polygon geometry destination and differing CRSs + params: + DESTINATION: + name: custom/polys_epsg31256.shp + type: vector + METHOD: '0' + NEIGHBORS: 1 + SOURCE: + name: custom/points.shp + type: vector + results: + OUTPUT: + name: expected/shortest_line_point_to_polygon_4326_to_31256.shp + type: vector + + - algorithm: native:shortestline + name: Test native:shortestline using nearest point on line geometry destination and differing CRSs + params: + DESTINATION: + name: custom/snap_lines_3857.shp + type: vector + METHOD: '0' + NEIGHBORS: 1 + SOURCE: + name: custom/points.shp + type: vector + results: + OUTPUT: + name: expected/shortest_line_point_to_line_4326_to_3857.shp type: vector # See ../README.md for a description of the file format