]> granicus.if.org Git - postgis/commitdiff
Fix SRID in ST_Homogenize output with collection input (#2129)
authorSandro Santilli <strk@keybit.net>
Mon, 3 Dec 2012 14:10:18 +0000 (14:10 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 3 Dec 2012 14:10:18 +0000 (14:10 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10783 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_homogenize.c
liblwgeom/lwhomogenize.c

index 811a067962a9c5c418c484f03638d69b6321abb3..19361d01d2a276b823c9c1b15a606a6ffe2aa848 100644 (file)
@@ -210,6 +210,18 @@ static void test_geom(void)
        do_geom_test("SRID=4326;GEOMETRYCOLLECTION EMPTY",
                     "SRID=4326;GEOMETRYCOLLECTION EMPTY");
 
+       /* See http://trac.osgeo.org/postgis/ticket/2129 */
+       do_geom_test("SRID=4326;GEOMETRYCOLLECTION(MULTIPOINT(0 0))",
+                    "SRID=4326;POINT(0 0)");
+
+       /* See http://trac.osgeo.org/postgis/ticket/2129 */
+       do_geom_test("SRID=4326;GEOMETRYCOLLECTION(MULTIPOINT(0 0, 1 2))",
+                    "SRID=4326;MULTIPOINT(0 0,1 2)");
+
+       /* See http://trac.osgeo.org/postgis/ticket/2129 */
+       do_geom_test("SRID=4326;GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 0))",
+                    "SRID=4326;GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 0))");
+
        do_geom_test("SRID=4326;POINT(1 2)",
                     "SRID=4326;POINT(1 2)");
 
@@ -249,4 +261,4 @@ CU_TestInfo homogenize_tests[] =
        PG_TEST(test_coll_curve),
        CU_TEST_INFO_NULL
 };
-CU_SuiteInfo homogenize_suite = {"Homogenize Suite",  NULL,  NULL, homogenize_tests};
+CU_SuiteInfo homogenize_suite = {"homogenize",  NULL,  NULL, homogenize_tests};
index a074b68e2cde56329ea99057885aade039cc8193..f2ee9dc5f70b861cea9103c248cab1e72af16bf5 100644 (file)
@@ -145,6 +145,7 @@ lwcollection_homogenize(const LWCOLLECTION *col)
                {
                        outgeom = lwcollection_as_lwgeom(outcol);
                }
+               outgeom->srid = col->srid;
        }
        /* Bah, more than out type, return anonymous collection */
        else if ( ntypes > 1 )