[postgis-tickets] r15520 - Missed test commit for ST_Centroid geography support
Regina Obe
lr at pcorp.us
Fri Aug 4 09:24:34 PDT 2017
Author: robe
Date: 2017-08-04 09:24:34 -0700 (Fri, 04 Aug 2017)
New Revision: 15520
Added:
trunk/regress/geography_centroid.sql
trunk/regress/geography_centroid_expected
Log:
Missed test commit for ST_Centroid geography support
References #2951
Added: trunk/regress/geography_centroid.sql
===================================================================
--- trunk/regress/geography_centroid.sql (rev 0)
+++ trunk/regress/geography_centroid.sql 2017-08-04 16:24:34 UTC (rev 15520)
@@ -0,0 +1,33 @@
+
+-- check for pole crossing
+SELECT c, ST_Centroid(g::geography) FROM
+( VALUES
+ ('geog_centroid_mpt_pole_north', 'MULTIPOINT ( 90 80, -90 80)'),
+ ('geog_centroid_mpt_pole_south', 'MULTIPOINT ( 90 -80, -90 -80)')
+) AS u(c, g);
+
+-- check for IDL crossing
+SELECT c, ST_Centroid(g::geography) FROM
+( VALUES
+ ('geog_centroid_mpt_idl_1', 'MULTIPOINT ( 179 0, -179 0)'),
+ ('geog_centroid_mpt_idl_2', 'MULTIPOINT ( 178 0, -179 0)'),
+ ('geog_centroid_mpt_idl_3', 'MULTIPOINT ( 179 0, -178 0)')
+) AS u(c, g);
+
+-- point should return itself
+SELECT c, ST_Centroid(g::geography) FROM
+( VALUES
+ ('geog_centroid_pt_self_1', 'POINT ( 4 8)'),
+ ('geog_centroid_pt_self_2', 'POINT ( -15 16)'),
+ ('geog_centroid_pt_self_3', 'POINT ( -23 -42)')
+) AS u(c, g);
+
+-- test supported geometry types
+SELECT c, ST_Centroid(g::geography) FROM
+( VALUES
+ ('geog_centroid_sup_pt', 'POINT (23 42)'),
+ ('geog_centroid_sup_line', 'LINESTRING(-20 35, 8 46)'),
+ ('geog_centroid_sup_mline', 'MULTILINESTRING((-5 45, 8 36), (1 49, 15 41))'),
+ ('geog_centroid_sup_poly', 'POLYGON((10.9099 50.6917,10.9483 50.6917,10.9483 50.6732,10.9099 50.6732,10.9099 50.6917))'),
+ ('geog_centroid_sup_mpoly', 'MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))')
+) AS u(c, g);
Added: trunk/regress/geography_centroid_expected
===================================================================
--- trunk/regress/geography_centroid_expected (rev 0)
+++ trunk/regress/geography_centroid_expected 2017-08-04 16:24:34 UTC (rev 15520)
@@ -0,0 +1,13 @@
+geog_centroid_mpt_pole_north|0101000020E610000000000000000000000000000000805640
+geog_centroid_mpt_pole_south|0101000020E6100000000000000000000000000000008056C0
+geog_centroid_mpt_idl_1|0101000020E610000000000000008066400000000000000000
+geog_centroid_mpt_idl_2|0101000020E610000000000000007066400000000000000000
+geog_centroid_mpt_idl_3|0101000020E610000000000000007066C00000000000000000
+geog_centroid_pt_self_1|0101000020E610000000000000000010400000000000002040
+geog_centroid_pt_self_2|0101000020E61000000000000000002EC00000000000003040
+geog_centroid_pt_self_3|0101000020E610000000000000000037C000000000000045C0
+geog_centroid_sup_pt|0101000020E610000000000000000037400000000000004540
+geog_centroid_sup_line|0101000020E6100000753A468ED7B21CC00371ADA1B0AC4440
+geog_centroid_sup_mline|0101000020E61000009809DA1111101440C8CB7BE13F784540
+geog_centroid_sup_poly|0101000020E610000032ABE2FEB2DB25407A5DAC8D5A574940
+geog_centroid_sup_mpoly|0101000020E610000028B38B0AF4FFFFFF28B38B0AF4FFFFFF
More information about the postgis-tickets
mailing list