Commit 86721085 authored by Sandro Santilli's avatar Sandro Santilli

Ensure lwcollection_segmentize2d always return a NEW geometry. Fixes ticket...

Ensure lwcollection_segmentize2d always return a NEW geometry. Fixes ticket #254. Add regression test for that bug.


git-svn-id: http://svn.osgeo.org/postgis/trunk@4542 b70326c6-7e19-0410-871a-916f4a2858ee
parent aeeb0a27
......@@ -321,7 +321,7 @@ lwcollection_segmentize2d(LWCOLLECTION *col, double dist)
unsigned int i;
LWGEOM **newgeoms;
if ( ! col->ngeoms ) return col;
if ( ! col->ngeoms ) return lwcollection_clone(col);
newgeoms = lwalloc(sizeof(LWGEOM *)*col->ngeoms);
for (i=0; i<col->ngeoms; i++)
......
......@@ -257,6 +257,7 @@ select '147_', asewkt(force_4d('POINT(1 2 3)'));
select '148', ST_astext(ST_segmentize('LINESTRING(0 0, 10 0)', 5));
select '148_', astext(segmentize('LINESTRING(0 0, 10 0)', 5));
select '149', ST_astext(segmentize('GEOMETRYCOLLECTION EMPTY', 0.5));
select '150', ST_asewkt(ST_force_collection(ST_setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6)));
select '150_', asewkt(force_collection(setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6)));
......
......@@ -180,6 +180,7 @@ HINT: "MULTIPOINT(1 1, 2 2" <-- parse error at position 19 within geometry
147_|POINT(1 2 3 0)
148|LINESTRING(0 0,5 0,10 0)
148_|LINESTRING(0 0,5 0,10 0)
149|GEOMETRYCOLLECTION EMPTY
150|SRID=6;GEOMETRYCOLLECTION(POLYGON((0 0,1 0,1 1,0 1,0 0)))
150_|SRID=6;GEOMETRYCOLLECTION(POLYGON((0 0,1 0,1 1,0 1,0 0)))
151|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment