[postgis-users] Need to combine several multilinestrings into one

Nicolas Ribot nicolas.ribot at gmail.com
Tue Sep 29 02:00:45 PDT 2015


Hello,

Use st_collect(pt.geom)

Nicolas

On 28 September 2015 at 22:05, Bistrais, Bob <Bob.Bistrais at maine.gov> wrote:

> I am trying to create one multilinestring from several multilinestrings.
> These are the geom results from a pgRouting query:
>
>
>
> SELECT pt.geom
>
>                 FROM pgr_dijkstra(
>
>                                 'SELECT gid AS id,
>
>                                                 sourceroute::integer as
> source,
>
>                                                 targetroute::integer as
> target,
>
>                                                 (feet / 5280)::double
> precision AS cost,
>
>                                                 feet::double precision as
> reverse_cost
>
>                                                 FROM
> ngrdsaroo2',2465,1713,false,true)
>
>                                                 as di
>
>                                                 JOIN ngrdsaroo2 pt on
> di.id2 = pt.gid
>
>
>
> -This returns many rows of multilinesting geometry.  I want to combine
> these into one geometry, so that I can save it as a route for display.
> I’ve tried ST_Union, ST_LineMerge, and others, but can’t seem to get
> anything to work, I keep getting errors.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150929/51a49d1b/attachment.html>


More information about the postgis-users mailing list