]> granicus.if.org Git - postgis/commitdiff
Add regression tests for using -s from_srid:to_srid with -D (copy mode) for both...
authorRegina Obe <lr@pcorp.us>
Mon, 29 Jul 2019 01:11:07 +0000 (01:11 +0000)
committerRegina Obe <lr@pcorp.us>
Mon, 29 Jul 2019 01:11:07 +0000 (01:11 +0000)
Closes #4403

git-svn-id: http://svn.osgeo.org/postgis/trunk@17624 b70326c6-7e19-0410-871a-916f4a2858ee

18 files changed:
regress/core/Makefile.in
regress/loader/ReprojectPtsD-post.sql [new file with mode: 0644]
regress/loader/ReprojectPtsD-pre.sql [new file with mode: 0644]
regress/loader/ReprojectPtsD.dbf [new file with mode: 0644]
regress/loader/ReprojectPtsD.opts [new file with mode: 0644]
regress/loader/ReprojectPtsD.select.expected [new file with mode: 0644]
regress/loader/ReprojectPtsD.select.sql [new file with mode: 0644]
regress/loader/ReprojectPtsD.shp [new file with mode: 0644]
regress/loader/ReprojectPtsD.shx [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD-post.sql [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD-pre.sql [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD-w.select.expected [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD.dbf [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD.opts [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD.select.expected [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD.select.sql [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD.shp [new file with mode: 0644]
regress/loader/ReprojectPtsGeogD.shx [new file with mode: 0644]

index d1fe0efd740e771896b7b88a1357107806910474..ad61bf0f5211c535dcef72e12c1c57844bd2a2ad 100644 (file)
@@ -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 (file)
index 0000000..4d480c6
--- /dev/null
@@ -0,0 +1,2 @@
+-- Cleanup\r
+DELETE FROM spatial_ref_sys;\r
diff --git a/regress/loader/ReprojectPtsD-pre.sql b/regress/loader/ReprojectPtsD-pre.sql
new file mode 100644 (file)
index 0000000..4e642fb
--- /dev/null
@@ -0,0 +1,11 @@
+--- In case this test is running in an extension context\r
+TRUNCATE spatial_ref_sys;\r
+---\r
+--- EPSG 4326 : WGS 84\r
+---\r
+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 ');\r
+---\r
+--- EPSG 2260 : NAD83 / New York East (ftUS)\r
+---\r
+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 ');\r
+\r
diff --git a/regress/loader/ReprojectPtsD.dbf b/regress/loader/ReprojectPtsD.dbf
new file mode 100644 (file)
index 0000000..cfaee4b
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 (file)
index 0000000..512f041
--- /dev/null
@@ -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 (file)
index 0000000..a0d5414
--- /dev/null
@@ -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 (file)
index 0000000..db0abb4
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(ST_SnapToGrid(the_geom,0.00000001)) from loadedshp;\r
+\r
diff --git a/regress/loader/ReprojectPtsD.shp b/regress/loader/ReprojectPtsD.shp
new file mode 100644 (file)
index 0000000..805fbb0
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 (file)
index 0000000..59f0cb9
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 (file)
index 0000000..b188c1a
--- /dev/null
@@ -0,0 +1,2 @@
+-- cleanup\r
+DELETE FROM spatial_ref_sys;\r
diff --git a/regress/loader/ReprojectPtsGeogD-pre.sql b/regress/loader/ReprojectPtsGeogD-pre.sql
new file mode 100644 (file)
index 0000000..8ae5d8e
--- /dev/null
@@ -0,0 +1,9 @@
+---\r
+--- EPSG 4326 : WGS 84\r
+---\r
+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 ');\r
+---\r
+--- EPSG 2260 : NAD83 / New York East (ftUS)\r
+---\r
+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 ');\r
+\r
diff --git a/regress/loader/ReprojectPtsGeogD-w.select.expected b/regress/loader/ReprojectPtsGeogD-w.select.expected
new file mode 100644 (file)
index 0000000..a0d5414
--- /dev/null
@@ -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 (file)
index 0000000..cfaee4b
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 (file)
index 0000000..161ebd2
--- /dev/null
@@ -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 (file)
index 0000000..a0d5414
--- /dev/null
@@ -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 (file)
index 0000000..15b9df9
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(ST_SnapToGrid(the_geom::geometry,0.00000001)) from loadedshp;\r
+\r
diff --git a/regress/loader/ReprojectPtsGeogD.shp b/regress/loader/ReprojectPtsGeogD.shp
new file mode 100644 (file)
index 0000000..805fbb0
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 (file)
index 0000000..59f0cb9
Binary files /dev/null and b/regress/loader/ReprojectPtsGeogD.shx differ