[postgis-devel] [PostGIS] #878: ST_LineMerge with collection

PostGIS trac at osgeo.org
Thu May 5 01:31:05 PDT 2011


#878: ST_LineMerge with collection
---------------------+------------------------------------------------------
 Reporter:  strk     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------
Description changed by strk:

Old 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.

New 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).

--

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/878#comment:2>
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-devel mailing list