Really accept collections and multipoints from ST_MakeValid (#1719)

Also updates documentation and SQL level tests.

git-svn-id: http://svn.osgeo.org/postgis/trunk@9894 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2012-06-12 09:30:34 +00:00
parent 6743c67e8f
commit 930fb6770d
4 changed files with 11 additions and 3 deletions

View 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>

View 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:

View 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;

View 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)