Opened 9 months ago

Closed 9 months ago

Last modified 5 weeks 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 (10)

comment:2 by Paul Ramsey <pramsey@…>, 9 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@…>, 9 months ago

In f37390b/git:

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

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

In b885f39b/git:

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

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

In bd10d04/git:

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

comment:6 by pramsey, 9 months ago

Resolution: fixed
Status: newclosed

comment:7 by robe, 9 months ago

Milestone: PostGIS 3.5.0PostGIS 3.2.8

comment:8 by Paul Ramsey <pramsey@…>, 5 weeks ago

In 22483969/git:

Retain SRID during unary union, references #5677

comment:9 by Paul Ramsey <pramsey@…>, 5 weeks ago

In 5b990cc/git:

Retain SRID during unary union, references #5677

comment:10 by Paul Ramsey <pramsey@…>, 5 weeks ago

In 6725b2c0/git:

Retain SRID during unary union, references #5677

Note: See TracTickets for help on using tickets.