Opened 11 years ago

Closed 11 years ago

#1703 closed defect (fixed)

osm2pgsql exports name for type=route relations

Reported by: ldp Owned by: jburgess777@…
Priority: minor Milestone:
Component: utils Version:
Keywords: osm2pgsql name route_name Cc:


When osm2pgsql is exporting a route to postgis, a route_name key is added, as a copy of the name field of the input relation. However, before it starts to evaluate the different types of relations, the source tags including 'name' are already copied. This causes both the 'name' and 'route_name' fields to be set and identical, for type=route relations.

Because the current osm.xml uses an <ElseFilter/?> while rendering road names, this causes the route names to also appear on the map when route_name and bicycle routes are enabled in Checking [route_name] as an exclusion for road name rendering instead of using an ElseFilter? is also not possible, since by default, the route_name column isn't enabled in, the column is not generated, and the whole Rule would fail to render.

Example of route name rendering:

I have added a patch for output-pgsql.c that defers setting the 'name' column in the exported relation, then skipping this for type=route, and finally setting it for the other type=* relations. I tested this locally, and the route names were no longer rendered on the osm.xml based map.

Heads up opencyclemap maintainers: If you're relying on [name] for type=route bicyle routes, this would break label rendering, until you switch to [route_name].

Attachments (1)

osm2pgsql-route_name.diff (1.2 KB) - added by ldp 11 years ago.
Don't set 'name' if 'route_name' is already being set

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by ldp

Attachment: osm2pgsql-route_name.diff added

Don't set 'name' if 'route_name' is already being set

comment:1 Changed 11 years ago by Tom Hughes

Owner: changed from Tom Hughes to jburgess777@…

comment:2 Changed 11 years ago by jburgess777@…

Resolution: fixed
Status: newclosed

I put in a fix for this in r15119. I did it slightly differently to your patch but the result should be the same.

Note: See TracTickets for help on using tickets.