[OSM-talk] Osm2pgsql/TileMill - how to detect whether way is in a route?

Steve Bennett stevagewp at gmail.com
Mon Mar 18 23:52:48 UTC 2013

  I'm trying to render a mountain bike map with TileMill. Some trails
are in route relations, eg:

3xWay: highway=path, mtb=yes
1xRelation: type=route, route=mtb, name="My Cool Trail"

Osm2pgsql converts those to 4 rows: the relation is the complete trail.

What I want to do is not render any way that is also part of a route
relation - in that case I just want to render the route.

One way to fudge this is to render the way, then render the route
relation over the top, obscuring it. But that doesn't work if you want
to use line smoothing (eg, line-smooth:0.6). The route relation will
form a smooth bezier curve the intersection of two ways, but the way
rendering will form a sharp point.

So I'm just wondering if there is a way around this - some setting in
osm2pgsql, some SQL magic I could play with. The ultimate goal would
be to be able to write rules like:

#trails[highway="path"][mb="yes"][in_mtb_route="no"] {


More information about the talk mailing list