I need to find a way to merge ways into one long lines with the same attributes. I heard I can use ST_Union but I don't know how. I have a postgresql database connect with tilemill. It works fine but I'm not familiar with postgis so I don't know how to write the subquery. What I want to achieve is to merge segments of ways into one.
Here is my subquery in tilemill:
( SELECT *
FROM planet_osm_line
WHERE route IN ('bicycle')
) AS data
And here is my table in postgresql:
These are ways converted from bicycle routes. I want to combine them into one. The reason is that when rendering every single segment gets split and on angles it doesn't look good.