Opened 13 years ago

Last modified 7 years ago

#878 closed enhancement

ST_LineMerge with collection — at Initial Version

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS Fund Me
Component: postgis Version: master
Keywords: Cc:

Description

According to GEOS dox about LineMerger:

  • Any dimension of Geometry is handled.
  • The constituent linework is extracted to form the edges.

According to PostGIS manual:

Only use with MULTILINESTRING/LINESTRINGs. If you feed a polygon or geometry collection into this function, it will return an empty GEOMETRYCOLLECTION

Reality:

SELECT ST_AsText(ST_LineMerge(
'GEOMETRYCOLLECTION(
   MULTILINESTRING(
    (1656318.45 4833344.45,1656321.79 4833339.62,1656312.54 4833333.49),
    (1656312.54 4833333.49,1656309.68 4833337.07)
   ),
   LINESTRING(1656309.68 4833337.07,1656318.45 4833344.45)
)'));
                        st_astext                        
---------------------------------------------------------
 LINESTRING(1656309.68 4833337.07,1656318.45 4833344.45)
(1 row)

Basically, the MULTILINESTRING part was simply _discarded_. Works fine if the input is transformed in a MULTILINESTRING (without the collection).

I'm not sure if the bug is in postgis or geos, will check. Surely dox of postgis and geos disagree on the matter.

Change History (0)

Note: See TracTickets for help on using tickets.