Module:Road data/strings/CAR

From IxWiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:Road data/strings/CAR/doc

--[==[
To inspect the content of this data module, use [[Special:ExpandTemplates]]
and enter the following input text:
  {{#invoke:Road data/dump|dump|module=Module:<name-of-this-module>}}

To inspect the content of this data module when editing, enter the following
into the Debug console:
  local util = require("Module:Road data/util")
  print(util.arrayToString(p))
To inspect a particular route type, change `p` above to include the route type,
e.g., `p.I` and `p["CA-Hist"]`.
]==]

-- Cartadania
local CAR = {}

local util = require("Module:Road data/util")
local format = mw.ustring.format

--[[ REGION-SPECIFIC SETTINGS ]]--
CAR[" common "] = {
	country = "Cartadania",
	locations = {
		indep_city = {
			linksuffix = ", %region%",
			prefix = "{{wp|Independent city (United States)|City}} of ",
			jcttoparticle = "the "
		},
		sub1 = {
			linksuffix = " County, %region%",
			jcttopnamesuffix = " County"
		},
		sub2 = {
			linksuffix = "[sub1dab||, %sub1dab% County|], %region%"
		},
		sub2areas = {
			city = {
				linksuffix = " (city)",
				jcttoparticle = "the ",
				nameprefix = "City of "
			},
			town = {
				linksuffix = " (town)",
				jcttoparticle = "the ",
				nameprefix = "Town of "
			},
			township = {
				linksuffix = " Township",
				namesuffix = " Township",
			},
			village = {
				linksuffix = " (village)",
				jcttoparticle = "the ",
				nameprefix = "Village of "
			}
		}
	}
}

--[[ ROUTE TYPES ]]--
-- disambiguation switch
CAR[" dab "] = "[dab|| (%dab%)|]"

-- definitions for auxiliary routes
CAR[" aux "] = {
	Alt = {
		name = "Alternate",
		abbrsuffix = "Alt.",
		arksuffix = "A",
		banneralt = "Alt",
	},
	Aux = {
		name = "Auxiliary",
		aux = "[[List of auxiliary Interstate Highways|Auxiliary route]]"
	},
	Bus = {
		name = "Business",
		abbrsuffix = "Bus.",
		arksuffix = "B"
	},
	Byp = {
		name = "Bypass",
		abbrsuffix = "Byp.",
		bannerprefix = "By-pass",
		aux = "[[Bypass (road)|Bypass]]"
	},
	City = {
		name = "City",
		arksuffix = "C"
	},
	Conn = {
		name = "Connector",
		abbrsuffix = "Conn.",
		arksuffix = "Y"
	},
	Detour = {
		name = "Detour",
		aux = "[[Detour (road)|Detour]]"
	},
	Emerg = {
		name = "Emergency",
		abbrsuffix = "Emerg."
	},
	Express = {
		name = "Express",
		aux = "Express route"
	},
	Future = {
		name = "Future",
		aux = "Future routing"
	},
	Local = {
		name = "Local",
		aux = "Local route"
	},
	Loop = {name = "Loop"},
	Old = {name = "Old"},
	Opt = {
		name = "Optional",
		abbrsuffix = "Opt."
	},
	Scenic = {name = "Scenic"},
	Spur = {
		name = "Spur",
		arksuffix = "S"
	},
	Temp = {
		name = "Temporary",
		abbrsuffix = "Temp."
	},
	Toll = {name = "Toll"},
    Truck = {
        name = "Truck",
        arksuffix = "T"
    },
}
-- fill out default values
for _,entry in pairs(CAR[" aux "]) do
	entry.abbrsuffix = entry.abbrsuffix or entry.name
	entry.bannerprefix =  entry.bannerprefix or entry.name
	entry.banneralt =  entry.banneralt or entry.bannerprefix
	entry.aux = entry.aux or format("[[%s route]]", entry.name)
end

CAR.IH = {
	base = "Interstate %route%",
	shield = "CAIH-%route%.svg",
	shieldmain= {
		arg = "state",
		["GU"] = "CAIH-%route% (GU).svg",
		["LI"] = "CAIH-%route% (LI).svg",
		["SA"] = "CAIH-%route% (SA).svg",
		["TN"] = "CAIH-%route% (TN).svg",
		["TS"] = "CAIH-%route% (TS).svg",
		["TO"] = "CAIH-%route% (TO).svg",
		["TR"] = "CAIH-%route% (TR).svg",
		["TA"] = "CAIH-%route% (TA).svg",
		default = "CAIH-%route%.svg"
	},
	name = "Interstate %route%",
	link = "Interstate %route%" .. CAR[" dab "],
	abbr = "CAIH-%route%",
	width = "expand",
	bannersuffix = "green",
	aux = {
		hook = "splitlen",
		split = 3,
		above = CAR[" aux "].Aux,
		below = ""
	}
}
CAR.I = CAR.IH

for _,auxType in ipairs({"Alt", "Express", "Future", "Local", "Spur", "Temp", "Toll", "Truck"}) do
	local spec = CAR[" aux "][auxType]
	CAR["IH-" .. auxType] = {
		shield = CAR.IH.shield,
		shieldmain = CAR.IH.shieldmain,
		name = CAR.IH.name .. " " .. spec.name,
		link = CAR.IH.base .. " " .. spec.name .. CAR[" dab "],
		abbr = CAR.IH.abbr .. " " .. spec.abbrsuffix,
		banner = spec.name .. " plate blue.svg",
		bannersuffix = CAR.IH.bannersuffix,
		aux = spec.aux,
		width = "expand"
	}
end

CAR["IH-Future"].shield = "CAIH-%route% (Future).svg"
CAR["IH-Future"].shieldmain = "CAIH-%route% (Future).svg"
CAR["IH-Future"].name = "Future " .. CAR.IH.name
CAR["IH-Temp"].name = "Temporary " .. CAR.IH.name
CAR["IH-Future"].abbr = "Future " .. CAR.IH.abbr
CAR["IH-Temp"].abbr = "Temp. " .. CAR.IH.name
CAR["IH-Express"].banner = "Express plate yellow.svg"
CAR["IH-Future"].banner = ""
CAR["IH-Local"].banner = "Local plate yellow.svg"
CAR["IH-Toll"].banner = "Toll plate yellow.svg"

CAR.Future = CAR["IH-Future"]
CAR["IH-Temporary"] = CAR["IH-Temp"]

for _,year in ipairs({"1957", "1961"}) do
	CAR["IH " .. year] = {
		shield = {
			arg = "state",
			default = format("CAIH-%%route%% (%s).svg", year),
			["AK"] = format("IH-A%%route%% (%s).svg", year),
			["HI"] = format("IH-H%%route%% (%s).svg", year)
		},
		shieldmain = {
			arg = "state",
			default = format("CAIH-%%route%% (%s).svg", year),
			["AC"] = format("CAIH-%%route%% (AC %s).svg", year),
			["AE"] = format("CAIH-%%route%% (AE %s).svg", year),
			["AL"] = format("CAIH-%%route%% (AL %s).svg", year),
			["AV"] = format("CAIH-%%route%% (AV %s).svg", year),
			["BA"] = format("CAIH-%%route%% (BA %s).svg", year),
			["CX"] = format("CAIH-%%route%% (CX %s).svg", year),
			["CA"] = format("CAIH-%%route%% (CA %s).svg", year),
			["CT"] = format("CAIH-%%route%% (CT %s).svg", year),
			["ES"] = format("CAIH-%%route%% (ES %s).svg", year),
			["FE"] = format("CAIH-%%route%% (FE %s).svg", year),
			["GU"] = format("CAIH-%%route%% (GU %s).svg", year),
			["LI"] = format("CAIH-%%route%% (LI %s).svg", year),
			["LO"] = format("CAIH-%%route%% (LO %s).svg", year),
			["LT"] = format("CAIH-%%route%% (LT %s).svg", year),
			["LM"] = format("CAIH-%%route%% (LM %s).svg", year),
			["MA"] = format("CAIH-%%route%% (MA %s).svg", year),
			["MF"] = format("CAIH-%%route%% (MF %s).svg", year),
			["NV"] = format("CAIH-%%route%% (NV %s).svg", year),
			["PB"] = format("CAIH-%%route%% (AC %s).svg", year),
			["SA"] = format("CAIH-%%route%% (SA %s).svg", year),
			["SR"] = format("CAIH-%%route%% (SR %s).svg", year),
			["SM"] = format("CAIH-%%route%% (SM %s).svg", year),
			["SG"] = format("CAIH-%%route%% (SG %s).svg", year),
			["SI"] = format("CAIH-%%route%% (SI %s).svg", year),
			["SL"] = format("CAIH-%%route%% (SL %s).svg", year),
			["TN"] = format("CAIH-%%route%% (TN %s).svg", year),
			["TS"] = format("CAIH-%%route%% (TS %s).svg", year),
			["TO"] = format("CAIH-%%route%% (TO %s).svg", year),
			["TR"] = format("CAIH-%%route%% (TR %s).svg", year),
			["TA"] = format("CAIH-%%route%% (TA %s).svg", year),
			["VA"] = format("CAIH-%%route%% (VA %s).svg", year),
			["VI"] = format("CAIH-%%route%% (VI %s).svg", year),			
			["VT"] = format("CAIH-%%route%% (VT %s).svg", year),
			},
		base = CAR.IH.base,
		name = CAR.IH.name,
		link = CAR.IH.link,
		abbr = CAR.IH.abbr,
		bannersuffix = "blue 1961"
	}
end

CAR["IH 1971"] = {
	shield = CAR["IH 1961"].shield,
	shieldmain = CAR["IH 1961"].shieldmain,
	base = CAR.IH.base,
	name = CAR.IH.name,
	link = CAR.IH.link,
	abbr = CAR.IH.abbr,
	bannersuffix = "blue 1971",
	width = "expand"
}


CAR["IH-named"] = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
}

CAR.BL = {
	shield = "Business Loop %route%.svg",
	name = CAR.IH.name .. " Business",
	link = CAR.IH.base .. " Business" .. CAR[" dab "],
	abbr = CAR.IH.abbr .. " BL",
	aux = "[[List of business routes of the Interstate Highway System|Business route]]",
	width = "expand"
}

CAR.BS = {
	shield = "Business Spur %route%.svg",
	name = CAR.BL.name,
	link = CAR.BL.link,
	abbr = CAR.IH.abbr .. " BS",
	aux = CAR.BL.aux,
	width = "expand"
}

CAR["BL 1957"] = {
	shield = "Business Loop %route% (1957).svg",
	name = CAR.BL.name,
	link = CAR.BL.link,
	abbr = CAR.BL.abbr,
	aux = CAR.BL.aux,
	bannersuffix = "green 1961"
}

CAR["BS 1957"] = {
	shield = "Business Spur %route% (1957).svg",
	name = CAR.BS.name,
	link = CAR.BS.link,
	abbr = CAR.BS.abbr,
	aux = CAR.BS.aux,
	bannersuffix = "green 1961"
}

CAR.BLBS = {
	shield = {CAR.BL.shield, CAR.BS.shield},
	name = CAR.IH.name .. " Business",
	link = CAR.IH.base .. " Business" .. CAR[" dab "],
	abbr = CAR.IH.abbr .. " Bus.",
	aux = "[[List of business routes of the Interstate Highway System|Business route]]",
	width = "expand"
}

CAR.CA = {
	base = "Cartadania Federal Highway %route%",
	shield = {
		arg = "state",
		["CA"] = "CA Federal %route% (1961 cutout).svg",
		default = "CAFH %route%.svg"
	},
	shieldmain = {
		arg = "state",
		["CA"] = "CA Federal %route% (1961 cutout).svg",
		default = {
			["85"] = {"CA Federal %route%.svg", "CanAm Highway.svg"},
			default = "CAFH %route%.svg"
		}
	},
	name = "Cartadania Federal Highway %route%",
	link = "CA Federal %route%" .. CAR[" dab "],
	abbr = "CA&nbsp;%route%",
	width = "expand",
	color = {
		arg = "route",
		["66"] = "hist"
	}
}

for _,auxType in ipairs({"Alt", "Bus", "Byp", "City", "Conn", "Detour", "Emerg", "Future", "Old", "Opt", "Scenic", "Spur", "Temp", "Toll", "Truck"}) do
	local spec = CAR[" aux "][auxType]
	CAR["CA-" .. auxType] = {
		shield = CAR.CA.shield,
		name = CAR.CA.name .. " " .. spec.name,
		link = CAR.CA.base .. " " .. spec.name .. CAR[" dab "],
		abbr = CAR.CA.abbr .. " " .. spec.abbrsuffix,
		banner = spec.bannerprefix .. " plate.svg",
		aux = spec.aux,
		width = "expand"
	}
end
CAR["CA-Toll"].banner = "Toll plate yellow.svg"
CAR["CA-City"].name = "City " .. CAR.CA.name
CAR["CA-City"].abbr = "City " .. CAR.CA.abbr
CAR["CA-Temp"].name = "Temporary " .. CAR.CA.name
CAR["CA-Temp"].abbr = "Temp. " .. CAR.CA.abbr

CAR["CA-Hist"] = {
	shield = "[state||CA %route% (%state% historic).svg|CA %route% (historic).svg]",
	name = "Historic " .. CAR.CA.name,
	link = CAR.CA.base .. CAR[" dab "],
	abbr = "Historic " .. CAR.CA.abbr .. CAR[" dab "],
	orientation = "upright",
	color = "hist"
}

for _,year in ipairs({"1926", "1948"}) do
	CAR["CA " .. year] = {
		shield = format("CA Federal %%route%% (%s).svg", year),
		shieldmain = {
			ifexist = true,
			arg = "state",
			otherwise = format("CA Federal %%route%% (%s)", year),
			["AL"] = format("CA Federal %%route%% Alabama %s.svg", year),
			["AZ"] = format("CA Federal %%route%% Arizona %s.svg", year),
			["AR"] = format("CA Federal %%route%% Arkansas %s.svg", year),
			["CA"] = format("CA Federal %%route%% California %s.svg", year),
			["CO"] = format("CA Federal %%route%% Colorado %s.svg", year),
			["CT"] = format("CA Federal %%route%% Connecticut %s.svg", year),
			["DE"] = format("CA Federal %%route%% Delaware %s.svg", year),
			["DC"] = format("CA Federal %%route%% District of Columbia %s.svg", year),
			["FL"] = format("CA Federal %%route%% Florida %s.svg", year),
			["GA"] = format("CA Federal %%route%% Georgia %s.svg", year),
			["ID"] = format("CA Federal %%route%% Idaho %s.svg", year),
			["IL"] = format("CA Federal %%route%% Illinois %s.svg", year),
			["IN"] = format("CA Federal %%route%% Indiana %s.svg", year),
			["IA"] = format("CA Federal %%route%% Iowa %s.svg", year),
			["KS"] = format("CA Federal %%route%% Kansas %s.svg", year),
			["KY"] = format("CA Federal %%route%% Kentucky %s.svg", year),
			["LA"] = format("CA Federal %%route%% Louisiana %s.svg", year),
			["ME"] = format("CA Federal %%route%% Maine %s.svg", year),
			["MD"] = format("CA Federal %%route%% Maryland %s.svg", year),
			["MA"] = format("CA Federal %%route%% Massachusetts %s.svg", year),
			["MI"] = format("CA Federal %%route%% Michigan %s.svg", year),
			["MN"] = format("CA Federal %%route%% Minnesota %s.svg", year),
			["MS"] = format("CA Federal %%route%% Mississippi %s.svg", year),
			["MO"] = format("CA Federal %%route%% Missouri %s.svg", year),
			["MT"] = format("CA Federal %%route%% Montana %s.svg", year),
			["NE"] = format("CA Federal %%route%% Nebraska %s.svg", year),
			["NV"] = format("CA Federal %%route%% Nevada %s.svg", year),
			["NH"] = format("CA Federal %%route%% New Hampshire %s.svg", year),
			["NJ"] = format("CA Federal %%route%% New Jersey %s.svg", year),
			["NM"] = format("CA Federal %%route%% New Mexico %s.svg", year),
			["NY"] = format("CA Federal %%route%% New York %s.svg", year),
			["NC"] = format("CA Federal %%route%% North Carolina %s.svg", year),
			["ND"] = format("CA Federal %%route%% North Dakota %s.svg", year),
			["OH"] = format("CA Federal %%route%% Ohio %s.svg", year),
			["OK"] = format("CA Federal %%route%% Oklahoma %s.svg", year),
			["OR"] = format("CA Federal %%route%% Oregon %s.svg", year),
			["PA"] = format("CA Federal %%route%% Pennsylvania %s.svg", year),
			["RI"] = format("CA Federal %%route%% Rhode Island %s.svg", year),
			["SC"] = format("CA Federal %%route%% South Carolina %s.svg", year),
			["SD"] = format("CA Federal %%route%% South Dakota %s.svg", year),
			["TN"] = format("CA Federal %%route%% Tennessee %s.svg", year),
			["TX"] = format("CA Federal %%route%% Texas %s.svg", year),
			["UT"] = format("CA Federal %%route%% Utah %s.svg", year),
			["VT"] = format("CA Federal %%route%% Vermont %s.svg", year),
			["VA"] = format("CA Federal %%route%% Virginia %s.svg", year),
			["WA"] = format("CA Federal %%route%% Washington %s.svg", year),
			["WV"] = format("CA Federal %%route%% West Virginia %s.svg", year),
			["WI"] = format("CA Federal %%route%% Wisconsin %s.svg", year),
			["WY"] = format("CA Federal %%route%% Wyoming %s.svg", year)
		},
		base = CAR.CA.base,
		name = CAR.CA.name,
		link = CAR.CA.link,
		abbr = CAR.CA.abbr,
		width = "square",
		bannersuffix = format("%s", year)
	}
end

CAR["US 1961"] = {
	shield = "CA Federal %route% (1961).svg",
	base = CAR.CA.base,
	name = CAR.CA.name,
	link = CAR.CA.link,
	abbr = CAR.CA.abbr,
	width = "square",
	bannersuffix = "1961"
}

CAR["US 1971"] = {
	shield = CAR.CA.shield,
	base = CAR.CA.base,
	name = CAR.CA.name,
	link = CAR.CA.link,
	abbr = CAR.CA.abbr,
	width = "expand",
	bannersuffix = "1971"
}

for k, v in pairs(CAR) do if k:find ("US 19%d%d") then 
	v.color = {
		arg = "route",
		["66"] = "hist"
	}
	end
end

CAR["CA-named"] = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
}

CAR.Byway = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
	color = "hist",
	bannersuffix = "brown",
}

CAR.Npkwy = {
	shield = "",
	shieldmain = "Logo of the Cartadanian National Park Service.svg",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
	color = "hist",
	bannersuffix = "brown",
}

CAR.BCB = {
	shield = "BLM Backcountry Byway.svg",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
	color = "hist",
	bannersuffix = "brown",
}
CAR["Back Country"] = CAR.BCB

CAR["FH-named"] = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
	color = "hist",
}

CAR.FFH = {
	shield = "Forest Route %route%.svg",
	name = "Federal Forest Highway %route%",
	link = "Forest Highway %route%",
	abbr = "FFH&nbsp;%route%",
	color = "hist",
	bannersuffix = "brown",
}
 
CAR.FH = {
	shield = "Forest Route %route%.svg",
	name = "Forest Highway %route%",
	link = "Forest Highway %route%",
	abbr = "FH&nbsp;%route%",
	color = "hist",
	bannersuffix = "brown"
}

CAR.FR = {
	shield = "Forest Route %route%.svg",
	name = "Forest Route %route%",
	link = "Forest Highway %route%",
	abbr = "FR&nbsp;%route%",
	color = "hist",
	bannersuffix = "brown"
}

CAR.NSB = {
	shield = "MUTCD D6-4.svg",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
	color = "hist"
}
CAR.FSB = CAR.NSB

CAR.NFSB = {
	shield = "National Forest Scenic Byway.svg",
	name = "%route% National Forest Scenic&nbsp;Byway",
	link = "%route% National Forest Scenic Byway",
	abbr = "%route% National Forest Scenic Byway",
	color = "hist"
}

CAR.Scenic = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
	color = "hist"
}

CAR.ADHS = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%"
}

CAR.ISTEA = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%"
}

CAR.NHS = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%"
}

CAR.Post = {
	shield = "",
	name = "%route%",
	link = "%route%",
	abbr = "%route%",
	color = "hist"
}
CAR.Postal = CAR.Post

CAR.CR = {
	shield = "CR %route% jct.svg",
	shieldmain = "[county||%county% |]County %route%.svg",
	base = "County Road %route%",
	name = "County Road %route%",
	link = "",
	abbr = "CR %route%"
}

CAR.road = {
	shield = '',
	name = "%route%",
	link = '',
	abbr = "%route%",
}
			  
CAR.USBR = {
	shield = "CABR %route%.svg",
	name = "Cartadania Bicycle Route %route%",
	link = "Cartadania Bicycle Route %route%" .. CAR[" dab "],
	abbr = "CABR %route%",
	orientation = "upright"
}

CAR["CABR 2009"] = {
	shield = "CABR %route% (2009).svg",
	name = CAR.CABR.name,
	link = CAR.CABR.link,
	abbr = CAR.CABR.abbr,
	orientation = CAR.CABR.orientation
}

return CAR