Changeset 4542

Show
Ignore:
Timestamp:
09/29/09 06:31:20 (2 years ago)
Author:
strk
Message:

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

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/liblwgeom/lwcollection.c

    r4168 r4542  
    322322        LWGEOM **newgeoms; 
    323323 
    324         if ( ! col->ngeoms ) return col; 
     324        if ( ! col->ngeoms ) return lwcollection_clone(col); 
    325325 
    326326        newgeoms = lwalloc(sizeof(LWGEOM *)*col->ngeoms); 
  • trunk/regress/regress_expected

    r3817 r4542  
    181181148|LINESTRING(0 0,5 0,10 0) 
    182182148_|LINESTRING(0 0,5 0,10 0) 
     183149|GEOMETRYCOLLECTION EMPTY 
    183184150|SRID=6;GEOMETRYCOLLECTION(POLYGON((0 0,1 0,1 1,0 1,0 0))) 
    184185150_|SRID=6;GEOMETRYCOLLECTION(POLYGON((0 0,1 0,1 1,0 1,0 0))) 
  • trunk/regress/regress.sql

    r3817 r4542  
    258258select '148_', astext(segmentize('LINESTRING(0 0, 10 0)', 5)); 
    259259 
     260select '149', ST_astext(segmentize('GEOMETRYCOLLECTION EMPTY', 0.5)); 
    260261 
    261262select '150', ST_asewkt(ST_force_collection(ST_setsrid('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry, 6)));