]> granicus.if.org Git - postgis/commitdiff
Really accept collections and multipoints from ST_MakeValid (#1719)
authorSandro Santilli <strk@keybit.net>
Tue, 12 Jun 2012 09:30:34 +0000 (09:30 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 12 Jun 2012 09:30:34 +0000 (09:30 +0000)
Also updates documentation and SQL level tests.

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

doc/reference_processing.xml
postgis/lwgeom_geos_clean.c
regress/clean.sql
regress/clean_expected

index cfba80b04c091972686dc44bb3bf26460daf5b65..0ee8383e0e8842d2963407d6c4e48f4c761c64de 100644 (file)
@@ -1579,9 +1579,11 @@ SELECT ST_AsEWKT(ST_LineToCurve(ST_GeomFromEWKT('LINESTRING(1 2 3, 3 4 8, 5 6 4,
     geometry without loosing any of the input vertices. 
     Already-valid geometries are returned w/out further intervention.
     </para>
-    
+
     <para>
-    Supported inputs are: LINESTRINGS, MULTILINESTRINGS, POLYGONS, MULTIPOLYGONS.
+    Supported inputs are: POINTS, MULTIPOINTS, LINESTRINGS,
+    MULTILINESTRINGS, POLYGONS, MULTIPOLYGONS and GEOMETRYCOLLECTIONS
+    containing any mix of them.
     </para>
     
     <para>
@@ -1594,7 +1596,7 @@ SELECT ST_AsEWKT(ST_LineToCurve(ST_GeomFromEWKT('LINESTRING(1 2 3, 3 4 8, 5 6 4,
     Single polygons may become multi-geometries in case of self-intersections.
     </para>
     
-    <para>Availability: 2.0.0, requires GEOS-3.3.0 or higher.</para>
+    <para>Availability: 2.0.0, requires GEOS-3.3.0 or higher. 2.1.0 added support for GEOMETRYCOLLECTION and MULTIPOINT.</para>
     
     <para>&Z_support;</para>
     
index 30220edc39ba89efd7a4c34639c794a71132c6c9..ce1a6bea4415ae811c48aaa0c519d9ad55e968c0 100644 (file)
@@ -68,10 +68,12 @@ Datum ST_MakeValid(PG_FUNCTION_ARGS)
        switch ( lwgeom_in->type )
        {
        case POINTTYPE:
+       case MULTIPOINTTYPE:
        case LINETYPE:
        case POLYGONTYPE:
        case MULTILINETYPE:
        case MULTIPOLYGONTYPE:
+       case COLLECTIONTYPE:
                break;
 
        default:
index 05d97595490e16cf23dcb1a214f07b2c8c6dc400..4d4e598e7d4f890711a2a4a2db6dda0e02d3704b 100644 (file)
@@ -46,5 +46,7 @@ SELECT origin,caseno,
 
 
 SELECT '#1719.1', ST_AsEWKT(ST_MakeValid('POINT(0 0)'));
+SELECT '#1719.2', ST_AsEWKT(ST_MakeValid('GEOMETRYCOLLECTION(POINT(0 0),MULTIPOINT(3 4,5 2),LINESTRING(4 4, 4 4),POLYGON((0 0,10 10,0 10,10 0,0 0)))'));
+SELECT '#1719.3', ST_AsEWKT(ST_MakeValid('MULTIPOINT(3 4,5 2)'));
 
 DROP TABLE clean_cases;
index 13ba3022ad26b08ef3b44634f560a92de517d774..d3159135fd8c2af985f2d2a8d0f6f2b036bf7c2e 100644 (file)
@@ -27,3 +27,5 @@ PG|3|t|t|f
 PG|4|t|t|f
 PG|5|t|t|f
 #1719.1|POINT(0 0)
+#1719.2|GEOMETRYCOLLECTION(POINT(0 0),MULTIPOINT(3 4,5 2),POINT(4 4),MULTIPOLYGON(((0 0,5 5,10 0,0 0)),((5 5,0 10,10 10,5 5))))
+#1719.3|MULTIPOINT(3 4,5 2)