From: Regina Obe Date: Mon, 29 Jul 2019 01:11:07 +0000 (+0000) Subject: Add regression tests for using -s from_srid:to_srid with -D (copy mode) for both... X-Git-Tag: 3.0.0alpha4~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc3a4a4f5a3f78312f4aa6e61f29decf4aef1a16;p=postgis Add regression tests for using -s from_srid:to_srid with -D (copy mode) for both geometry and geography Closes #4403 git-svn-id: http://svn.osgeo.org/postgis/trunk@17624 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/regress/core/Makefile.in b/regress/core/Makefile.in index d1fe0efd7..ad61bf0f5 100644 --- a/regress/core/Makefile.in +++ b/regress/core/Makefile.in @@ -61,7 +61,9 @@ TESTS = \ ../loader/NotReallyMultiPoint \ ../loader/MultiToSinglePoint \ ../loader/ReprojectPts \ + ../loader/ReprojectPtsD \ ../loader/ReprojectPtsGeog \ + ../loader/ReprojectPtsGeogD \ ../loader/Latin1 \ ../loader/Latin1-implicit \ ../loader/mfile \ diff --git a/regress/loader/ReprojectPtsD-post.sql b/regress/loader/ReprojectPtsD-post.sql new file mode 100644 index 000000000..4d480c650 --- /dev/null +++ b/regress/loader/ReprojectPtsD-post.sql @@ -0,0 +1,2 @@ +-- Cleanup +DELETE FROM spatial_ref_sys; diff --git a/regress/loader/ReprojectPtsD-pre.sql b/regress/loader/ReprojectPtsD-pre.sql new file mode 100644 index 000000000..4e642fb96 --- /dev/null +++ b/regress/loader/ReprojectPtsD-pre.sql @@ -0,0 +1,11 @@ +--- In case this test is running in an extension context +TRUNCATE spatial_ref_sys; +--- +--- EPSG 4326 : WGS 84 +--- +INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'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.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '); +--- +--- EPSG 2260 : NAD83 / New York East (ftUS) +--- +INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (2260,'EPSG',2260,'PROJCS["NAD83 / New York East (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.83333333333334],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",492125],PARAMETER["false_northing",0],AUTHORITY["EPSG","2260"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs '); + diff --git a/regress/loader/ReprojectPtsD.dbf b/regress/loader/ReprojectPtsD.dbf new file mode 100644 index 000000000..cfaee4bf1 Binary files /dev/null and b/regress/loader/ReprojectPtsD.dbf differ diff --git a/regress/loader/ReprojectPtsD.opts b/regress/loader/ReprojectPtsD.opts new file mode 100644 index 000000000..512f0419f --- /dev/null +++ b/regress/loader/ReprojectPtsD.opts @@ -0,0 +1,3 @@ +# This happens to be a multipoint shapefile that has only single points, so use -S. +# It is in NJ State Plane NAD83, so reproject to 4326 using copy mode +-D -S -s 2260:4326 diff --git a/regress/loader/ReprojectPtsD.select.expected b/regress/loader/ReprojectPtsD.select.expected new file mode 100644 index 000000000..a0d541410 --- /dev/null +++ b/regress/loader/ReprojectPtsD.select.expected @@ -0,0 +1,66 @@ +SRID=4326;POINT(-74.17782492 41.08263361) +SRID=4326;POINT(-74.44881286 40.50133744) +SRID=4326;POINT(-74.00376358 40.28149688) +SRID=4326;POINT(-75.12863742 39.7797389) +SRID=4326;POINT(-74.57629014 40.85597595) +SRID=4326;POINT(-74.47160401 40.52369066) +SRID=4326;POINT(-75.46891683 39.69688334) +SRID=4326;POINT(-75.11458618 39.70739231) +SRID=4326;POINT(-74.22643701 40.09726563) +SRID=4326;POINT(-74.26766926 40.83522615) +SRID=4326;POINT(-74.42152037 40.76232181) +SRID=4326;POINT(-74.18666598 40.89980341) +SRID=4326;POINT(-74.20201874 40.94448827) +SRID=4326;POINT(-74.31866663 40.6680465) +SRID=4326;POINT(-74.83205963 40.84912898) +SRID=4326;POINT(-74.64402101 39.96633708) +SRID=4326;POINT(-74.22194028 40.09559148) +SRID=4326;POINT(-74.60375255 40.75504208) +SRID=4326;POINT(-74.09376018 40.86569336) +SRID=4326;POINT(-74.4430374 40.77797967) +SRID=4326;POINT(-74.76841703 40.22038455) +SRID=4326;POINT(-74.19078182 40.73914574) +SRID=4326;POINT(-74.19628444 40.79591416) +SRID=4326;POINT(-74.19130306 40.74330253) +SRID=4326;POINT(-74.17636308 40.73783123) +SRID=4326;POINT(-74.53148731 39.49029456) +SRID=4326;POINT(-74.16618054 40.73634864) +SRID=4326;POINT(-74.35732607 40.80076793) +SRID=4326;POINT(-74.17573811 40.73901418) +SRID=4326;POINT(-74.66491581 40.34572735) +SRID=4326;POINT(-74.36625323 40.51061374) +SRID=4326;POINT(-74.17631876 40.74329159) +SRID=4326;POINT(-74.4544664 40.52427239) +SRID=4326;POINT(-74.02836656 40.89756584) +SRID=4326;POINT(-75.00833975 39.82895026) +SRID=4326;POINT(-74.13132221 40.33161528) +SRID=4326;POINT(-74.67999522 39.46203859) +SRID=4326;POINT(-74.08904806 40.9515804) +SRID=4326;POINT(-75.12091068 39.94826917) +SRID=4326;POINT(-74.08628025 40.70929009) +SRID=4326;POINT(-74.73270242 40.27825159) +SRID=4326;POINT(-74.16625303 40.01000431) +SRID=4326;POINT(-75.01837982 40.74472398) +SRID=4326;POINT(-74.65920653 40.34951097) +SRID=4326;POINT(-74.24751143 40.74434122) +SRID=4326;POINT(-74.65122484 40.25151634) +SRID=4326;POINT(-74.43880205 40.4659008) +SRID=4326;POINT(-74.2355417 40.68231466) +SRID=4326;POINT(-74.49892935 40.80763833) +SRID=4326;POINT(-74.0625762 40.73086062) +SRID=4326;POINT(-75.03600164 39.78659251) +SRID=4326;POINT(-75.05591643 39.44084942) +SRID=4326;POINT(-74.39804333 40.50086907) +SRID=4326;POINT(-74.07131567 40.72720191) +SRID=4326;POINT(-74.19117919 40.74196293) +SRID=4326;POINT(-74.02494262 40.74676479) +SRID=4326;POINT(-74.68894668 40.6094749) +SRID=4326;POINT(-74.44600226 40.49825884) +SRID=4326;POINT(-74.19898991 40.85779571) +SRID=4326;POINT(-74.7828046 40.27094999) +SRID=4326;POINT(-74.25017536 40.217432) +SRID=4326;POINT(-74.16960551 40.91844326) +SRID=4326;POINT(-74.75788852 41.06754763) +SRID=4326;POINT(-74.03363729 40.72689071) +SRID=4326;POINT(-74.5760699 40.53743164) +SRID=4326;POINT(-74.43925667 40.77359187) diff --git a/regress/loader/ReprojectPtsD.select.sql b/regress/loader/ReprojectPtsD.select.sql new file mode 100644 index 000000000..db0abb4c8 --- /dev/null +++ b/regress/loader/ReprojectPtsD.select.sql @@ -0,0 +1,2 @@ +select ST_Asewkt(ST_SnapToGrid(the_geom,0.00000001)) from loadedshp; + diff --git a/regress/loader/ReprojectPtsD.shp b/regress/loader/ReprojectPtsD.shp new file mode 100644 index 000000000..805fbb0b8 Binary files /dev/null and b/regress/loader/ReprojectPtsD.shp differ diff --git a/regress/loader/ReprojectPtsD.shx b/regress/loader/ReprojectPtsD.shx new file mode 100644 index 000000000..59f0cb913 Binary files /dev/null and b/regress/loader/ReprojectPtsD.shx differ diff --git a/regress/loader/ReprojectPtsGeogD-post.sql b/regress/loader/ReprojectPtsGeogD-post.sql new file mode 100644 index 000000000..b188c1aaf --- /dev/null +++ b/regress/loader/ReprojectPtsGeogD-post.sql @@ -0,0 +1,2 @@ +-- cleanup +DELETE FROM spatial_ref_sys; diff --git a/regress/loader/ReprojectPtsGeogD-pre.sql b/regress/loader/ReprojectPtsGeogD-pre.sql new file mode 100644 index 000000000..8ae5d8e84 --- /dev/null +++ b/regress/loader/ReprojectPtsGeogD-pre.sql @@ -0,0 +1,9 @@ +--- +--- EPSG 4326 : WGS 84 +--- +INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (4326,'EPSG',4326,'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.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs '); +--- +--- EPSG 2260 : NAD83 / New York East (ftUS) +--- +INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (2260,'EPSG',2260,'PROJCS["NAD83 / New York East (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",38.83333333333334],PARAMETER["central_meridian",-74.5],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",492125],PARAMETER["false_northing",0],AUTHORITY["EPSG","2260"],AXIS["X",EAST],AXIS["Y",NORTH]]','+proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=us-ft +no_defs '); + diff --git a/regress/loader/ReprojectPtsGeogD-w.select.expected b/regress/loader/ReprojectPtsGeogD-w.select.expected new file mode 100644 index 000000000..a0d541410 --- /dev/null +++ b/regress/loader/ReprojectPtsGeogD-w.select.expected @@ -0,0 +1,66 @@ +SRID=4326;POINT(-74.17782492 41.08263361) +SRID=4326;POINT(-74.44881286 40.50133744) +SRID=4326;POINT(-74.00376358 40.28149688) +SRID=4326;POINT(-75.12863742 39.7797389) +SRID=4326;POINT(-74.57629014 40.85597595) +SRID=4326;POINT(-74.47160401 40.52369066) +SRID=4326;POINT(-75.46891683 39.69688334) +SRID=4326;POINT(-75.11458618 39.70739231) +SRID=4326;POINT(-74.22643701 40.09726563) +SRID=4326;POINT(-74.26766926 40.83522615) +SRID=4326;POINT(-74.42152037 40.76232181) +SRID=4326;POINT(-74.18666598 40.89980341) +SRID=4326;POINT(-74.20201874 40.94448827) +SRID=4326;POINT(-74.31866663 40.6680465) +SRID=4326;POINT(-74.83205963 40.84912898) +SRID=4326;POINT(-74.64402101 39.96633708) +SRID=4326;POINT(-74.22194028 40.09559148) +SRID=4326;POINT(-74.60375255 40.75504208) +SRID=4326;POINT(-74.09376018 40.86569336) +SRID=4326;POINT(-74.4430374 40.77797967) +SRID=4326;POINT(-74.76841703 40.22038455) +SRID=4326;POINT(-74.19078182 40.73914574) +SRID=4326;POINT(-74.19628444 40.79591416) +SRID=4326;POINT(-74.19130306 40.74330253) +SRID=4326;POINT(-74.17636308 40.73783123) +SRID=4326;POINT(-74.53148731 39.49029456) +SRID=4326;POINT(-74.16618054 40.73634864) +SRID=4326;POINT(-74.35732607 40.80076793) +SRID=4326;POINT(-74.17573811 40.73901418) +SRID=4326;POINT(-74.66491581 40.34572735) +SRID=4326;POINT(-74.36625323 40.51061374) +SRID=4326;POINT(-74.17631876 40.74329159) +SRID=4326;POINT(-74.4544664 40.52427239) +SRID=4326;POINT(-74.02836656 40.89756584) +SRID=4326;POINT(-75.00833975 39.82895026) +SRID=4326;POINT(-74.13132221 40.33161528) +SRID=4326;POINT(-74.67999522 39.46203859) +SRID=4326;POINT(-74.08904806 40.9515804) +SRID=4326;POINT(-75.12091068 39.94826917) +SRID=4326;POINT(-74.08628025 40.70929009) +SRID=4326;POINT(-74.73270242 40.27825159) +SRID=4326;POINT(-74.16625303 40.01000431) +SRID=4326;POINT(-75.01837982 40.74472398) +SRID=4326;POINT(-74.65920653 40.34951097) +SRID=4326;POINT(-74.24751143 40.74434122) +SRID=4326;POINT(-74.65122484 40.25151634) +SRID=4326;POINT(-74.43880205 40.4659008) +SRID=4326;POINT(-74.2355417 40.68231466) +SRID=4326;POINT(-74.49892935 40.80763833) +SRID=4326;POINT(-74.0625762 40.73086062) +SRID=4326;POINT(-75.03600164 39.78659251) +SRID=4326;POINT(-75.05591643 39.44084942) +SRID=4326;POINT(-74.39804333 40.50086907) +SRID=4326;POINT(-74.07131567 40.72720191) +SRID=4326;POINT(-74.19117919 40.74196293) +SRID=4326;POINT(-74.02494262 40.74676479) +SRID=4326;POINT(-74.68894668 40.6094749) +SRID=4326;POINT(-74.44600226 40.49825884) +SRID=4326;POINT(-74.19898991 40.85779571) +SRID=4326;POINT(-74.7828046 40.27094999) +SRID=4326;POINT(-74.25017536 40.217432) +SRID=4326;POINT(-74.16960551 40.91844326) +SRID=4326;POINT(-74.75788852 41.06754763) +SRID=4326;POINT(-74.03363729 40.72689071) +SRID=4326;POINT(-74.5760699 40.53743164) +SRID=4326;POINT(-74.43925667 40.77359187) diff --git a/regress/loader/ReprojectPtsGeogD.dbf b/regress/loader/ReprojectPtsGeogD.dbf new file mode 100644 index 000000000..cfaee4bf1 Binary files /dev/null and b/regress/loader/ReprojectPtsGeogD.dbf differ diff --git a/regress/loader/ReprojectPtsGeogD.opts b/regress/loader/ReprojectPtsGeogD.opts new file mode 100644 index 000000000..161ebd294 --- /dev/null +++ b/regress/loader/ReprojectPtsGeogD.opts @@ -0,0 +1,3 @@ +# This happens to be a multipoint shapefile that has only single points, so use -S. +# It is in NJ State Plane NAD83, using the -D copy mode, -s reproject to 4326, -G flag cast a geography. +-D -S -s 2260:4326 -G diff --git a/regress/loader/ReprojectPtsGeogD.select.expected b/regress/loader/ReprojectPtsGeogD.select.expected new file mode 100644 index 000000000..a0d541410 --- /dev/null +++ b/regress/loader/ReprojectPtsGeogD.select.expected @@ -0,0 +1,66 @@ +SRID=4326;POINT(-74.17782492 41.08263361) +SRID=4326;POINT(-74.44881286 40.50133744) +SRID=4326;POINT(-74.00376358 40.28149688) +SRID=4326;POINT(-75.12863742 39.7797389) +SRID=4326;POINT(-74.57629014 40.85597595) +SRID=4326;POINT(-74.47160401 40.52369066) +SRID=4326;POINT(-75.46891683 39.69688334) +SRID=4326;POINT(-75.11458618 39.70739231) +SRID=4326;POINT(-74.22643701 40.09726563) +SRID=4326;POINT(-74.26766926 40.83522615) +SRID=4326;POINT(-74.42152037 40.76232181) +SRID=4326;POINT(-74.18666598 40.89980341) +SRID=4326;POINT(-74.20201874 40.94448827) +SRID=4326;POINT(-74.31866663 40.6680465) +SRID=4326;POINT(-74.83205963 40.84912898) +SRID=4326;POINT(-74.64402101 39.96633708) +SRID=4326;POINT(-74.22194028 40.09559148) +SRID=4326;POINT(-74.60375255 40.75504208) +SRID=4326;POINT(-74.09376018 40.86569336) +SRID=4326;POINT(-74.4430374 40.77797967) +SRID=4326;POINT(-74.76841703 40.22038455) +SRID=4326;POINT(-74.19078182 40.73914574) +SRID=4326;POINT(-74.19628444 40.79591416) +SRID=4326;POINT(-74.19130306 40.74330253) +SRID=4326;POINT(-74.17636308 40.73783123) +SRID=4326;POINT(-74.53148731 39.49029456) +SRID=4326;POINT(-74.16618054 40.73634864) +SRID=4326;POINT(-74.35732607 40.80076793) +SRID=4326;POINT(-74.17573811 40.73901418) +SRID=4326;POINT(-74.66491581 40.34572735) +SRID=4326;POINT(-74.36625323 40.51061374) +SRID=4326;POINT(-74.17631876 40.74329159) +SRID=4326;POINT(-74.4544664 40.52427239) +SRID=4326;POINT(-74.02836656 40.89756584) +SRID=4326;POINT(-75.00833975 39.82895026) +SRID=4326;POINT(-74.13132221 40.33161528) +SRID=4326;POINT(-74.67999522 39.46203859) +SRID=4326;POINT(-74.08904806 40.9515804) +SRID=4326;POINT(-75.12091068 39.94826917) +SRID=4326;POINT(-74.08628025 40.70929009) +SRID=4326;POINT(-74.73270242 40.27825159) +SRID=4326;POINT(-74.16625303 40.01000431) +SRID=4326;POINT(-75.01837982 40.74472398) +SRID=4326;POINT(-74.65920653 40.34951097) +SRID=4326;POINT(-74.24751143 40.74434122) +SRID=4326;POINT(-74.65122484 40.25151634) +SRID=4326;POINT(-74.43880205 40.4659008) +SRID=4326;POINT(-74.2355417 40.68231466) +SRID=4326;POINT(-74.49892935 40.80763833) +SRID=4326;POINT(-74.0625762 40.73086062) +SRID=4326;POINT(-75.03600164 39.78659251) +SRID=4326;POINT(-75.05591643 39.44084942) +SRID=4326;POINT(-74.39804333 40.50086907) +SRID=4326;POINT(-74.07131567 40.72720191) +SRID=4326;POINT(-74.19117919 40.74196293) +SRID=4326;POINT(-74.02494262 40.74676479) +SRID=4326;POINT(-74.68894668 40.6094749) +SRID=4326;POINT(-74.44600226 40.49825884) +SRID=4326;POINT(-74.19898991 40.85779571) +SRID=4326;POINT(-74.7828046 40.27094999) +SRID=4326;POINT(-74.25017536 40.217432) +SRID=4326;POINT(-74.16960551 40.91844326) +SRID=4326;POINT(-74.75788852 41.06754763) +SRID=4326;POINT(-74.03363729 40.72689071) +SRID=4326;POINT(-74.5760699 40.53743164) +SRID=4326;POINT(-74.43925667 40.77359187) diff --git a/regress/loader/ReprojectPtsGeogD.select.sql b/regress/loader/ReprojectPtsGeogD.select.sql new file mode 100644 index 000000000..15b9df907 --- /dev/null +++ b/regress/loader/ReprojectPtsGeogD.select.sql @@ -0,0 +1,2 @@ +select ST_Asewkt(ST_SnapToGrid(the_geom::geometry,0.00000001)) from loadedshp; + diff --git a/regress/loader/ReprojectPtsGeogD.shp b/regress/loader/ReprojectPtsGeogD.shp new file mode 100644 index 000000000..805fbb0b8 Binary files /dev/null and b/regress/loader/ReprojectPtsGeogD.shp differ diff --git a/regress/loader/ReprojectPtsGeogD.shx b/regress/loader/ReprojectPtsGeogD.shx new file mode 100644 index 000000000..59f0cb913 Binary files /dev/null and b/regress/loader/ReprojectPtsGeogD.shx differ