[postgis-users] Aggregated Group By and ST_LineMerge

Stephen Woodbridge woodbri at swoodbridge.com
Wed Jan 11 08:45:30 PST 2012


On 1/11/2012 10:18 AM, Elijah Meeks wrote:
> I'm using pgRouting to find a shortest path through a network and the
> result is a set of polylines.  I'd like to combine these polylines
> into a single geometry using ST_LineMerge.  Coming from MySQL, I was
> looking for some kind of Group Concat function, but that doesn't seem
> to be available.  Does anyone have any suggestions?

Try something like:

select st_linemerge(st_collectionextract(st_collect(the_geom), 2)) as 
path from ...

-Steve



More information about the postgis-users mailing list