[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.1-33-ge1856ea
git at osgeo.org
git at osgeo.org
Tue May 18 17:42:29 PDT 2021
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, stable-3.1 has been updated
via e1856ea8b9029929c02c2b3ca3efbf0b32d546a8 (commit)
from 38ab76ac397dbf977a409824ebb55651d63e9060 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e1856ea8b9029929c02c2b3ca3efbf0b32d546a8
Author: Regina Obe <lr at pcorp.us>
Date: Tue May 18 20:30:43 2021 -0400
Break proj tests out more split basic and add more basic tests
diff --git a/regress/core/regress_proj_basic.sql b/regress/core/regress_proj_adhoc.sql
similarity index 78%
copy from regress/core/regress_proj_basic.sql
copy to regress/core/regress_proj_adhoc.sql
index 41c98be..5d2814c 100644
--- a/regress/core/regress_proj_basic.sql
+++ b/regress/core/regress_proj_adhoc.sql
@@ -1,8 +1,6 @@
-- some transform() regression
-
-- prime spatial_ref_sys table with two projections
-
--- EPSG 100001 : WGS 84 / UTM zone 33N
INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (100001,'EPSG',100001,'PROJCS["WGS 84 / UTM zone 33N",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","1000002"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","100001"]]','+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ');
--- EPSG 100002 : WGS 84
@@ -12,26 +10,11 @@ INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4tex
--- test #0: NULL values
SELECT 0,coalesce(ST_AsText(ST_transform(NULL::geometry, 100001)),'EMPTY');
---- test #1: a simple projection
-SELECT 1,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),100001),10));
-
---- test #2: same in 3D
-SELECT 2,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48 171)'),100001),10));
-
---- test #3: same in 4D
-SELECT 3,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48 171 -500)'),100001),10));
-
---- test #4: LINESTRING projection, 2 points
-SELECT 4,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;LINESTRING(16 48, 16 49)'),100001),10));
-
---- test #5: LINESTRING projection, 2 points, 4D
-SELECT 5,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;LINESTRING(16 48 0 0, 16 49 0 0)'),100001),10));
-
--- test #6: re-projecting a projected value
SELECT 6,round(ST_X(ST_transform(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),100001), 100002))::numeric,8),round(ST_Y(ST_transform(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),100001), 100002))::numeric,8);
--- test #7: Should yield an error since input SRID is unknown
-SELECT ST_transform(ST_GeomFromEWKT('SRID=0;POINT(0 0)'),100002);
+SELECT 7, ST_transform(ST_GeomFromEWKT('SRID=0;POINT(0 0)'),100002);
--- test #8: Transforming to same SRID
SELECT 8,ST_AsEWKT(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(0 0)'),100002));
diff --git a/regress/core/regress_proj_basic_expected b/regress/core/regress_proj_adhoc_expected
similarity index 51%
copy from regress/core/regress_proj_basic_expected
copy to regress/core/regress_proj_adhoc_expected
index b2792e7..bc6cbb5 100644
--- a/regress/core/regress_proj_basic_expected
+++ b/regress/core/regress_proj_adhoc_expected
@@ -1,9 +1,4 @@
0|EMPTY
-1|SRID=100001;POINT(574600 5316780)
-2|SRID=100001;POINT(574600 5316780 171)
-3|SRID=100001;POINT(574600 5316780 171 -500)
-4|SRID=100001;LINESTRING(574600 5316780,573140 5427940)
-5|SRID=100001;LINESTRING(574600 5316780 0 0,573140 5427940 0 0)
6|16.00000000|48.00000000
ERROR: ST_Transform: Input geometry has unknown (0) SRID
8|SRID=100002;POINT(0 0)
diff --git a/regress/core/regress_proj_basic.sql b/regress/core/regress_proj_basic.sql
index 41c98be..ca406e1 100644
--- a/regress/core/regress_proj_basic.sql
+++ b/regress/core/regress_proj_basic.sql
@@ -1,17 +1,11 @@
-- some transform() regression
-
-- prime spatial_ref_sys table with two projections
-
--- EPSG 100001 : WGS 84 / UTM zone 33N
INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (100001,'EPSG',100001,'PROJCS["WGS 84 / UTM zone 33N",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","1000002"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","100001"]]','+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs ');
--- EPSG 100002 : WGS 84
INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (100002,'EPSG',100002,'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","100002"]]','+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ');
--- Repeat all tests with the new function names.
---- test #0: NULL values
-SELECT 0,coalesce(ST_AsText(ST_transform(NULL::geometry, 100001)),'EMPTY');
-
--- test #1: a simple projection
SELECT 1,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),100001),10));
@@ -27,33 +21,10 @@ SELECT 4,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;LINES
--- test #5: LINESTRING projection, 2 points, 4D
SELECT 5,ST_AsEWKT(ST_SnapToGrid(ST_transform(ST_GeomFromEWKT('SRID=100002;LINESTRING(16 48 0 0, 16 49 0 0)'),100001),10));
---- test #6: re-projecting a projected value
-SELECT 6,round(ST_X(ST_transform(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),100001), 100002))::numeric,8),round(ST_Y(ST_transform(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),100001), 100002))::numeric,8);
-
---- test #7: Should yield an error since input SRID is unknown
-SELECT ST_transform(ST_GeomFromEWKT('SRID=0;POINT(0 0)'),100002);
-
---- test #8: Transforming to same SRID
-SELECT 8,ST_AsEWKT(ST_transform(ST_GeomFromEWKT('SRID=100002;POINT(0 0)'),100002));
-
-SELECT 9, ST_AsEWKT(ST_SnapToGrid(ST_Transform(
- ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),
- '+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs '), 10));
-
---- test #10: Transform from_proj to_proj
-SELECT 10, ST_AsEWKT(ST_SnapToGrid(ST_Transform(
- ST_GeomFromEWKT('POINT(16 48)'),
- '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ',
- '+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs '), 10));
-
---- test #11: Transform from_proj to_srid
-SELECT 11, ST_AsEWKT(ST_SnapToGrid(ST_Transform(
- ST_GeomFromEWKT('POINT(16 48)'),
- '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ', 100001), 10));
-
---- test #12: Transform with bad to_proj
-SELECT 12, ST_AsEWKT(ST_Transform(
- ST_GeomFromEWKT('SRID=100002;POINT(16 48)'),
- 'invalid projection'));
-
DELETE FROM spatial_ref_sys WHERE srid in (100001, 100002);
+
+SELECT 'M1', ST_AsText(ST_SnapToGrid(st_transform('SRID=4326;POINT(-20 -20)'::geometry, 3857),1));
+SELECT 'M2', ST_AsText(ST_SnapToGrid(st_transform('SRID=4326;POINT(-20 -21.5)'::geometry, 3857),1));
+SELECT 'M3', ST_AsText(ST_SnapToGrid(st_transform('SRID=4326;POINT(-30 -21.5)'::geometry, 3857),1));
+SELECT 'M4', ST_AsText(ST_SnapToGrid(st_transform('SRID=4326;POINT(-72.345 41.3)'::geometry, 3857),1));
+SELECT 'M5', ST_AsText(ST_SnapToGrid(st_transform('SRID=4326;POINT(71.999 -42.5)'::geometry, 3857),1));
diff --git a/regress/core/regress_proj_basic_expected b/regress/core/regress_proj_basic_expected
index b2792e7..cf79fc9 100644
--- a/regress/core/regress_proj_basic_expected
+++ b/regress/core/regress_proj_basic_expected
@@ -1,13 +1,10 @@
-0|EMPTY
1|SRID=100001;POINT(574600 5316780)
2|SRID=100001;POINT(574600 5316780 171)
3|SRID=100001;POINT(574600 5316780 171 -500)
4|SRID=100001;LINESTRING(574600 5316780,573140 5427940)
5|SRID=100001;LINESTRING(574600 5316780 0 0,573140 5427940 0 0)
-6|16.00000000|48.00000000
-ERROR: ST_Transform: Input geometry has unknown (0) SRID
-8|SRID=100002;POINT(0 0)
-9|POINT(574600 5316780)
-10|POINT(574600 5316780)
-11|SRID=100001;POINT(574600 5316780)
-ERROR: could not parse proj string 'invalid projection'
+M1|POINT(-2226390 -2273031)
+M2|POINT(-2226390 -2451599)
+M3|POINT(-3339585 -2451599)
+M4|POINT(-8053409 5056693)
+M5|POINT(8014892 -5236174)
diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index 23b3ed1..1b32ec3 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -71,6 +71,7 @@ TESTS += \
$(topsrcdir)/regress/core/regress_ogc_cover \
$(topsrcdir)/regress/core/regress_ogc_prep \
$(topsrcdir)/regress/core/regress_proj_basic \
+ $(topsrcdir)/regress/core/regress_proj_adhoc \
$(topsrcdir)/regress/core/regress_proj_cache_overflow \
$(topsrcdir)/regress/core/regress_proj_4890 \
$(topsrcdir)/regress/core/relate \
-----------------------------------------------------------------------
Summary of changes:
...gress_proj_basic.sql => regress_proj_adhoc.sql} | 19 +---------
..._basic_expected => regress_proj_adhoc_expected} | 5 ---
regress/core/regress_proj_basic.sql | 41 ++++------------------
regress/core/regress_proj_basic_expected | 13 +++----
regress/core/tests.mk.in | 1 +
5 files changed, 13 insertions(+), 66 deletions(-)
copy regress/core/{regress_proj_basic.sql => regress_proj_adhoc.sql} (78%)
copy regress/core/{regress_proj_basic_expected => regress_proj_adhoc_expected} (51%)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list