openstreetmap-carto icon indicating copy to clipboard operation
openstreetmap-carto copied to clipboard

Add pictorial route shields

Open 1ec5 opened this issue 11 years ago • 61 comments

In many parts of the world, the cartographic convention is to mark routes with graphical shields resembling road signage. This renderer marks routes with plain text badges that are suitable for countries that identify routes with consistent alphabetic prefixes, such as the U.K.’s M/A/B scheme. However, in countries that use graphical shields, this style makes OSM look foreign and much less impressive to potential contributors.

In the U.S., this renderer’s plain text badges often lead to disagreements and edit wars about the proper format of ref tags on ways. Some would prefer the ref tag to reflect real-world written usage (e.g. “I-10” for an Interstate route or “SR 123” for a state route), while others have pushed for a uniform, machine-readable syntax with a unique alphabetic prefix for each route network (“I 10” and “CA 123”). The U.S. is currently a patchwork of these schemes.

Meanwhile, we already have very good penetration of type=route relations, which solve this problem with a separate, machine-readable network tag. But we still squabble over the ref tag on ways because route relations are ignored by mainstream renderers. #495 requested arbitrary route shields based on URLs in the symbol tag, but that suggestion should scare anyone who wants to deploy a renderer based on live OSM data. Instead, we should maintain a large set of shield images in the symbols directory and select from these images using the network tag on route relations.

@asciiphil has built a fully-functional prototype (source) based on this idea. This renderer currently supports a variety of national, state, and some county and township routes in the U.S.; provincial routes in Canada; federal routes in Mexico; and some Australian routes. It also handles concurrencies and banners, which are difficult to express with ref tags on ways. It could easily be extended to handle country-specific shields in Europe (such as the blue hexagons in Germany), provided that route relations are used. The shield renderer is popular among members of the talk-us mailing list, but it needs to be ported over to the new Carto stylesheets.

Mapnik Shields

Mapnik Shields

Mapnik Shields

The shield renderer stores a series of public domain “template” SVG images which each have SVG text placeholders for route numbers. A “sequences” folder contains files that list ranges of valid route numbers for each route network. A preprocessing step assembles SVG images for each valid route number for each network. The Mapnik stylesheets look for these images.

For countries that rely on graphical shields, rendering them accurately is a functional requirement, not an aesthetic one. Please consider implementing functionality similar to what the shield renderer provides (if not necessarily the same pipeline). Thank you!

1ec5 avatar Apr 26 '14 23:04 1ec5