[postgis-users] st_linemerge not working with 4d coords

Paul Ramsey pramsey at cleverelephant.ca
Sat May 10 08:35:21 PDT 2014


LineMerge is implemented via the GEOS library which, unlike PostGIS,
only understands 3 dimensions max. So the 4th is sacrificed in the
process. There's no good / easy way to retain it. you could write a
post-process routine that took every output vertex and compared it to
the input geometry to try and figure out what the original M dimension
was, I suppose.

P.

On Thu, May 8, 2014 at 8:38 AM, Paolo Importuni <imppao at gmail.com> wrote:
> Hi everybody,
>
> I am trying to merge two linestring like in the following example:
>
> select st_astext(st_linemerge(st_collect(ST_GeomFromEWKT('LINESTRING(5 5 5
> 5, 10 10 10 10)'),ST_GeomFromEWKT('LINESTRING(10 10 10 10 , 15 15 15
> 15)'))));
>
>
> but the output is
> "LINESTRING Z (5 5 5,10 10 10,15 15 15)"
>
> that is,  the 4th dimension is lost.
>
> Can anyone please explain  me the reason  and how to overcome this problem?
>
> Thanks and best regards
>
> Paolo
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list