Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#5677 closed defect (fixed)

ST_Union(geom[]) doesn't union single member arrays

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 3.2.8
Component: postgis Version: 3.4.x
Keywords: Cc: robe

Description

Compare

select
 st_asewkt(
   st_union(
     array[
       st_geomfromtext(
         'GEOMETRYCOLLECTION(
           POLYGON((0 0,10 0,25 25,0 10,0 0)),
           POLYGON((20 20,30 20,30 30,20 30,20 20))
         )'
       )
     ]
   )
 )

and

select
 st_asewkt(
   st_union(
     array[
       st_geomfromtext(
         'GEOMETRYCOLLECTION(
           POLYGON((0 0,10 0,25 25,0 10,0 0)),
           POLYGON((20 20,30 20,30 30,20 30,20 20))
         )'
       ),
       st_geomfromtext(
         'GEOMETRYCOLLECTION(
           POLYGON((100 100, 110 100, 110 110, 100 100))
         )'
       )
     ]
   )
 )

Change History (7)

comment:2 by Paul Ramsey <pramsey@…>, 4 months ago

In 15c8d95/git:

Union the contents of a single-member array before returning, so that collections get flattened. References #5677

comment:3 by Paul Ramsey <pramsey@…>, 4 months ago

In f37390b/git:

ST_Union(geom[]) should unary union single entry arrays
References #5677

comment:4 by Paul Ramsey <pramsey@…>, 4 months ago

In b885f39b/git:

ST_Union(geom[]) should unary union single entry arrays
References #5677

comment:5 by Paul Ramsey <pramsey@…>, 4 months ago

In bd10d04/git:

ST_Union(geom[]) should unary union single entry arrays
References #5677

comment:6 by pramsey, 4 months ago

Resolution: fixed
Status: newclosed

comment:7 by robe, 4 months ago

Milestone: PostGIS 3.5.0PostGIS 3.2.8
Note: See TracTickets for help on using tickets.