id summary reporter owner description type status priority milestone component version resolution keywords cc 5117 aggregate st_union ignores linestring of zero length anneb pramsey "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; }}} " defect closed medium PostGIS 3.3.0 postgis 3.2.x invalid