Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#254 closed defect (fixed)

ST_Segmentize crashes with empty geometry collections

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.4.1
Component: postgis Version: master
Keywords: Cc:

Description

SELECT ST_Segmentize(ST_GeomFromText('GEOMETRYCOLLECTION EMPTY'), 0.5);

Breaks on both 1.4 and 1.5 on my PostgreSQL 8.4 windows install. Though I don't have a 1.3 handy to test.

Attachments (1)

segmentize.patch (426 bytes ) - added by strk 15 years ago.
Suggested patch

Download all attachments as: .zip

Change History (4)

comment:1 by strk, 15 years ago

Try this:

Index: liblwgeom/lwcollection.c =================================================================== --- liblwgeom/lwcollection.c (revision 4541) +++ liblwgeom/lwcollection.c (working copy) @@ -321,7 +321,7 @@

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

by strk, 15 years ago

Attachment: segmentize.patch added

Suggested patch

comment:2 by strk, 15 years ago

Resolution: fixed
Status: newclosed

Committed togheter with regression test in r4542.

comment:3 by robe, 15 years ago

backported to branck 1.4 -- r4545 (didn't bother backporting the regress test).

Note: See TracTickets for help on using tickets.