[postgis-tickets] [PostGIS] #5117: aggregate st_union ignores linestring of zero length

PostGIS trac at osgeo.org
Tue Mar 22 16:32:33 PDT 2022


#5117: aggregate st_union ignores linestring of zero length
---------------------+---------------------------
 Reporter:  anneb    |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 3.3.0
Component:  postgis  |    Version:  3.2.x
 Keywords:           |
---------------------+---------------------------
 The aggregate version of st_union ignores zero length linestrings while
 similar functions do not.

 The following ignores the first linestring:
 {{{
 with lines as (
   select st_geomfromewkt('srid=3857;LINESTRING(5 5,5 5)') as geom
   union all
   select st_geomfromewkt('srid=3857;LINESTRING(1 1, 2 2)') as geom
   )
 select st_union(geom) from lines;
 }}}



 However, the following examples include the first linestring
 {{{
 -- non-aggregate version of st_union:
 select st_union(st_geomfromewkt('srid=3857;LINESTRING(5 5,5 5)'),
  st_geomfromewkt('srid=3857;LINESTRING(1 1, 2 2)'));

 -- aggregate versions of st_extent and st_collect:
 with lines as (
   select st_geomfromewkt('srid=3857;LINESTRING(5 5,5 5)') as geom
   union all
   select st_geomfromewkt('srid=3857;LINESTRING(1 1, 2 2)') as geom
   )
 select st_extent(geom) from lines;

 with lines as (
   select st_geomfromewkt('srid=3857;LINESTRING(5 5,5 5)') as geom
   union all
   select st_geomfromewkt('srid=3857;LINESTRING(1 1, 2 2)') as geom
   )
 select st_collect(geom) from lines;
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5117>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list