Custom Highway Shields
Description
Many people would love to see custom highway shields rendered by mapnik, this lookup table is designed to facilitate this.
For this page LGA means Local Government Area, this can be a county, or a council or a shire or .... but has less power and less area than a state.
For this to work, ways need to be joined into a route relation, with a network=* and ref=* tags, eg
type=route route=road name=Bruxner Highway network=NH ref=44
FORMAT
The format of these tables is used to feed the formatting program. That means, you should not just change the table layout. If you do, then you need to update the program as well.
Tagging issues
It seems in the US and Brazil that the state has been added to the network=* or ref=* tags because people didn't think of using the state and LGA boundaries, I will probably be flamed but this seems to be duplicating information that can be pulled from polygons and shouldn't be duplicated in tags.
In the US, there are actually a number of highways signed by one state that go into another. Local government areas overlap somewhat chaotically. There are also various jurisdictions that have different classifications of road signed differently: "reference routes," "touring routes," "farm and market routes" and so on. There just didn't seem to be any alternative to network=*.
is_in, addr:* and similar tags shouldn't be used either for the same reason.
Notes
Regex for most people is a pain in the butt, it will also make lookups easier especially when matching partial tags, for example an MABC route will have a ref=M1, so you will need to match the ref field as M\d.*, this sort of lookup would match M1a also, but the first character after the M must be a number.
This lookup table only supports road route relations, another lookup table will need to be produced for things like matching operator tags to banks, fast food places etc.
Countries should be looked up based on the surrounding polygon with admin_level=2. States should be admin_level=4. LGAs would be admin_level=6.
Rendering
The SVG images below can be rendered using inkscape from the command line as osm2pgsql etc figure out what signs are needed, these should in theory render better than trying to arbitarily plot numbers on PNG images, this is a work around until mapnik can handle SVG images directly.
cat imgae.svg | sed "s/XXX/123/" | inkscape --export-png=image.png --export-width=100 /dev/stdin
Regular Expressions
They don't display and/or get munged by the wiki, there is some php code on the discussion page converting non-alphanumeric characters to html characters.
Australia
Brazil
United States of America
Note: All U.S. state shields containing digits are svg text placeholders, and can be replaced with text using the Roadgeek fonts. Look for the <text>
or <tspan>
element.
See also
- United States/Road signs/Generic shields – on the perils of taking a shortcut with generic shields
- Road signs in the United States – with links to existing implementations
- Ohio/Route relations/Networks – documentation on the multitude of route networks and shields in the U.S. state of Ohio
- OpenStreetMap Americana – a renderer that displays many of the shields on this page based on route relations
External links
- Rebusurance – shield designs optimized for map and navigation contexts