[postgis-tickets] [PostGIS] #4991: st_union of single row should keep the row intact

PostGIS trac at osgeo.org
Thu Sep 16 09:05:27 PDT 2021


#4991: st_union of single row should keep the row intact
----------------------+---------------------------
  Reporter:  michal   |      Owner:  pramsey
      Type:  defect   |     Status:  closed
  Priority:  medium   |  Milestone:  PostGIS 3.1.5
 Component:  postgis  |    Version:  3.1.x
Resolution:  invalid  |   Keywords:
----------------------+---------------------------

Comment (by michal):

 I do service like [https://mhd.oma.sk/-133867] where I collect data from
 OSM (linestring or multilinesting), grouping by id in the OSM database.
 osm2pgsql does a great job of importing and merging data, but sometimes I
 have to alter the multilinestring (eg removing platforms from tram
 routes). Then query like `select st_union(way) from planet_osm_line where
 platform is null and osm_id=123` creates usually a linestring (and not
 multilinestring). Sometimes the number of matching rows is 1, sometimes
 2+. but since `st_memunion` keeps the data intact, I do not have to make
 if-else before the query (which I like very, very much, please do not
 change it :) ).

 having linestrings allows to use `st_linelocatepoint` - so info like
 'there is a bus stop named AAA after 1.5km'

 in this particular linestring, it is a bus line which makes a left turn
 over a bridge, so when crossing itself the Z index is different. but the Z
 index is dropped during import, because it's not needed (so the postgis
 data is 2D only).

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4991#comment:6>
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