Custom Highway Shields

From OpenStreetMap Wiki
Jump to navigation Jump to search

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 .* RJ-.svg 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 .* SP-.png 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} US DOT FHWA MUTCD SHS 2004 3-1 M1-1 600x600mm 0.svg Interstate highways
.* .* I (\d{3}|\d{2}[EW]) US DOT FHWA MUTCD SHS 2004 3-1 M1-1 750x600mm 000.svg Interstate highways (3-char)
.* .* US \d{1,2} US blank.svg US highway
.* .* US \d{3} US blank wide.svg US highway (3-digit)
CA .* US .* US blank (CA).svg US highway in California
.* .* (US:DE|US:IA|US:KY) \d{2} Shield state generic blank.svg Generic state highway (used for 2-digit signs in Delaware, Iowa, and Kentucky)
.* .* US:IA \d{3} Shield state generic blank.svg Generic state highway (used for 3-digit signs in Iowa)
.* .* (US:DE|US:KY) \d{3} Shield state generic blank wide.svg Generic state highway, wide (used for 3-digit signs in Delaware and Kentucky)
.* .* (US:KY) \d{4} Shield state generic blank wide.svg Generic state highway, wide (used for 4-digit signs in Kentucky)
.* .* US:AL \d{2} Shield state alabama blank.svg State highway in Alabama
.* .* US:AL \d{3} Alabama 000 Template.svg State highway in Alabama (3-digit)
.* .* US:AK .* Shield state alaska blank.svg State highway in Alaska
.* .* US:AK:BUS .* Shield state alaska business template.svg State highway in Alaska (Business route)
.* .* US:AZ .{2} Shield state arizona template.svg State highway in Arizona
.* .* US:AZ .{3} Shield state arizona template wide.svg State highway in Arizona (3-digit)
.* .* US:AR .* Shield state arkansas blank.svg State highway in Arkansas
.* .* US:CA \d{1,2} Shield state california blank.svg State highway in California
.* .* US:CA \d{3} Shield state california blank wide.svg State highway in California (3-digit)
.* .* US:CO .* Shield state colorado blank.svg State highway in Colorado
.* .* US:CT .* Shield state connecticut blank.svg State highway in Connecticut
.* .* US:DC .* Shield state dc blank.svg State highway in the District of Columbia
.* .* US:FL .{1,2} Shield state florida blank.svg State highway in Florida (1- and 2-digit)
.* .* US:FL .{3,4} Shield state florida blank wide.svg State highway in Florida (3- and 4-digit)
.* .* US:GA .* Shield state georgia blank.svg State highway in Georgia
.* .* US:HI .* Shield state hawaii blank.svg State highway in Hawaii
.* .* US:ID .{1,2} Idaho 00 template.svg State highway in Idaho
.* .* US:ID .{3} Idaho 000 template.svg State highway in Idaho (wide)
.* .* US:IL .{1,2} Shield state illinois blank.svg State highway in Illinois
IL .* US:IL .{3} Shield state illinois blank wide.svg State highway in Illinois (wide)
.* .* US:IN .{1,2} Shield state indiana blank.svg State highway in Indiana
.* .* US:IN .{3} Shield state indiana blank wide.svg State highway in Indiana (wide)
.* .* US:KS .{1,2} Shield state kansas blank.svg State highway in Kansas
.* .* US:KS .{3} Shield state kansas blank wide.svg State highway in Kansas (wide)
.* .* US:LA .* Louisiana 0000 (2008) template.svg State highway in Louisiana
.* .* US:MD .{1,2} Shield state maryland template.svg State highway in Maryland
.* .* US:MD .{3} Shield state maryland template wide.svg State highway in Maryland (wide)
.* .* US:MT .{1,2} MT.svg State highway in Montana
.* .* US:OH \d{1,2} Ohio State Route template.svg State highway in Ohio
Routes numbered in the form 12A are unsigned. Use <text id="ref"> as placeholder.
.* .* US:OH \d{3} Ohio State Route template (wide).svg State highway in Ohio (wide)
Routes numbered in the form 123A are unsigned. Use <text id="ref"> as placeholder.
PA .* US:PA .{1,2} Shield state pennsylvania blank.svg State highway in Pennsylvania
PA .* US:PA .{3} Shield state pennsylvania blank wide.svg State highway in Pennsylvania (wide)

See also

External links

  • Rebusurance – shield designs optimized for map and navigation contexts