Opened 10 years ago

Closed 10 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:

Description

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 default.style. 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 default.style, the column is not generated, and the whole Rule would fail to render.

Example of route name rendering: http://tile.openstreetmap.nl/?zoom=15&lat=51.22925&lon=3.7797&layers=B000000F

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 10 years ago.
Don't set 'name' if 'route_name' is already being set

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by ldp

Attachment: osm2pgsql-route_name.diff added

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

comment:1 Changed 10 years ago by Tom Hughes

Owner: changed from Tom Hughes to jburgess777@…

comment:2 Changed 10 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.