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

Brazil
State LGA Network Ref SVG Image Description/Notes
.* .* BR .* National highway
.* .* BR:AC .* State highway, Acre
.* .* BR:AL .* State highway, Alagoas
.* .* BR:AM .* State highway, Amazonas
.* .* BR:AP .* State highway, Amapá
.* .* BR:BA .* State highway, Bahia
.* .* BR:CE .* State highway, Ceará
.* .* BR:DF .* State highway, Distrito Federal
.* .* BR:ES .* State highway, Espírito Santo
.* .* BR:GO .* State highway, Goiás
.* .* BR:MA .* State highway, Maranhão
.* .* BR:MG .* State highway, Minas Gerais
.* .* BR:MS .* State highway, Mato Grosso do Sul
.* .* BR:MT .* State highway, Mato Grosso
.* .* BR:PA .* State highway, Pará
.* .* BR:PB .* State highway, Paraíba
.* .* BR:PI .* State highway, Piauí
.* .* BR:PR .* State highway, Paraná
.* .* BR:RJ .* State highway, Rio de Janeiro
.* .* BR:RN .* State highway, Rio Grande do Norte
.* .* BR:RO .* State highway, Rondônia
.* .* BR:RR .* State highway, Roraima
.* .* BR:RS .* State highway, Rio Grande do Sul
.* .* BR:SC .* State highway, Santa Catarina
.* .* BR:SE .* State highway, Sergipe
.* .* BR:SP .* State highway, São Paulo
.* .* BR:TO .* State highway, Tocatins

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.

United States of America
State LGA Network Ref SVG Image Description/Notes
.* .* I \d{1,2} Interstate highways
.* .* I (\d{3}|\d{2}[EW]) Interstate highways (3-char)
.* .* US \d{1,2} US highway
.* .* US \d{3} US highway (3-digit)
CA .* US .* US highway in California
.* .* (US:DE|US:IA|US:KY) \d{2} Generic state highway (used for 2-digit signs in Delaware, Iowa, and Kentucky)
.* .* US:IA \d{3} Generic state highway (used for 3-digit signs in Iowa)
.* .* (US:DE|US:KY) \d{3} Generic state highway, wide (used for 3-digit signs in Delaware and Kentucky)
.* .* (US:KY) \d{4} Generic state highway, wide (used for 4-digit signs in Kentucky)
.* .* US:AL \d{2} State highway in Alabama
.* .* US:AL \d{3} State highway in Alabama (3-digit)
.* .* US:AK .* State highway in Alaska
.* .* US:AK:BUS .* State highway in Alaska (Business route)
.* .* US:AZ .{2} State highway in Arizona
.* .* US:AZ .{3} State highway in Arizona (3-digit)
.* .* US:AR .* State highway in Arkansas
.* .* US:CA \d{1,2} State highway in California
.* .* US:CA \d{3} State highway in California (3-digit)
.* .* US:CO .* State highway in Colorado
.* .* US:CT .* State highway in Connecticut
.* .* US:DC .* State highway in the District of Columbia
.* .* US:FL .{1,2} State highway in Florida (1- and 2-digit)
.* .* US:FL .{3,4} State highway in Florida (3- and 4-digit)
.* .* US:GA .* State highway in Georgia
.* .* US:HI .* State highway in Hawaii
.* .* US:ID .{1,2} State highway in Idaho
.* .* US:ID .{3} State highway in Idaho (wide)
.* .* US:IL .{1,2} State highway in Illinois
IL .* US:IL .{3} State highway in Illinois (wide)
.* .* US:IN .{1,2} State highway in Indiana
.* .* US:IN .{3} State highway in Indiana (wide)
.* .* US:KS .{1,2} State highway in Kansas
.* .* US:KS .{3} State highway in Kansas (wide)
.* .* US:LA .* State highway in Louisiana
.* .* US:MD .{1,2} State highway in Maryland
.* .* US:MD .{3} State highway in Maryland (wide)
.* .* US:MT .{1,2} State highway in Montana
.* .* US:OH \d{1,2} State highway in Ohio
Routes numbered in the form 12A are unsigned. Use <text id="ref"> as placeholder.
.* .* US:OH \d{3} State highway in Ohio (wide)
Routes numbered in the form 123A are unsigned. Use <text id="ref"> as placeholder.
PA .* US:PA .{1,2} State highway in Pennsylvania
PA .* US:PA .{3} State highway in Pennsylvania (wide)

See also

  • Rebusurance – shield designs optimized for map and navigation contexts
This article is issued from Openstreetmap. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.