Jump to content

Module:Road data/strings/USA/PA

Permanently protected module
From Wikipedia, the free encyclopedia

--[==[
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["US-Hist"]`.
]==]

-- Pennsylvania
local PA = {}

local format = mw.ustring.format
local util = require("Module:Road data/util")
util.addAll(PA, require("Module:Road data/strings/USA"))

local suffix = " ([dab||%dab%, |]Pennsylvania)"
local maint = "[[Pennsylvania Department of Transportation|PennDOT]]"

PA.I.link = "Interstate %route% (Pennsylvania)"

for k, v in pairs(PA) do if k:find ("^I") then 
	v.link = PA.I.link
	end
end

PA.BL.link = "Interstate %route% Business ([dab||%dab%, |]Pennsylvania)"

for k, v in pairs(PA) do if k:find ("^BL") then 
	v.link = PA.BL.link
	end
end

PA.US.link = {
	["122"] = "U.S. Route 122 (%dab%)",
	default = "U.S. Route %route% in Pennsylvania"
	}

for k, v in pairs(PA) do if k:find ("^US %d") then 
	v.name = PA.US.name
	v.link = PA.US.link
	end
end

for _,auxType in ipairs({"Alt", "Bus", "Byp", "City", "Conn", "Emerg", "Opt", "Scenic", "Spur", "Temp", "Toll", "Truck"}) do
	local spec = PA[" aux "][auxType]
		for k, v in pairs(PA) do if k:find (auxType) then if k:find ("^US") then
			v.name = PA.US.name .. " " .. spec.name
			v.link = PA.US.base .. " " .. spec.name .. " ([dab||%dab%, |]Pennsylvania)"
			end
		end
	end
end
PA["US 1948"].bannersuffix = "1948"
PA["US 1961"].shield = "US %route% (1961 cutout).svg"
PA["US 1961"].bannersuffix = "1961"
	
PA["US-Truck-Alt"] = {
	shield = PA.US.shield,
	name = PA["US-Alt"].name .. " Truck",
	link = "U.S. Route %route% Alternate Truck ([dab||%dab%, |]Pennsylvania)",
	abbr = "US&nbsp;%route% Alt. Truck",
	banner = "Alternate truck plate.svg",
	width = "expand",
	aux = PA[" aux "].Truck
}
PA["US-Alt-Truck"] = PA["US-Truck-Alt"]
	
PA["US-Bus-Alt-Truck"] = {
	shield = PA.US.shield,
	name = PA["US-Bus"].name .. " Alternate Truck",
	link = "U.S. Route %route% Business Alternate Truck ([dab||%dab%, |]Pennsylvania)",
	abbr = "US&nbsp;%route% Bus. Alt. Truck",
	banner = "Business-alternate-truck plate.svg",
	width = "expand",
	aux = PA[" aux "].Truck
}
PA["US-Bus-Truck-Alt"] = PA["US-Bus-Alt-Truck"]

for _,year in ipairs({'1926', '1948', '1961'}) do
	for _,auxType in ipairs({"Alt", "Bus", "Byp", "Conn", "Opt", "Scenic", "Spur", "Temp", "Truck"}) do
		local type = "US " .. year
		local spec = PA[" aux "][auxType]
		PA[type .. "-" .. auxType] = {
			shield = PA[type].shield,
			shieldmain = PA[type].shieldmain,
			name = PA[type].name .. " " .. spec.name,
			link = PA[type].base .. " " .. spec.name .. suffix,
			abbr = PA[type].abbr .. " " .. spec.abbrsuffix,
			banner = spec.bannerprefix .. " plate " .. year .. ".svg",
			bannersuffix = year,
			aux = spec.aux,
			width = PA[type].width
		}
	end
end

PA.SR = {
	base = "Pennsylvania Route %route%",
	shield = "PA-%route%.svg",
	shieldmain = {
		["66"] = {"PA-%route%.svg", "Turnpike-%route%.svg"},
		["179"] = {"PA-%route%.svg", "Ellipse sign %route%.svg"},
		["491"] = {"PA-%route%.svg", "Ellipse sign %route%.svg"},
		default = "PA-%route%.svg"
	},
    name = {
		["179"] = "Route %route%",
		["491"] = "Route %route%",
		default = "Pennsylvania Route %route%"
	},
	link = "Pennsylvania Route %route% [dab||(%dab%)|]",
	abbr = "PA&nbsp;%route%",
	width = "expand"
}
PA.PA = PA.SR

for _,type in ipairs({"SR", "PA"}) do
	for _,year in ipairs({"1926", "1948", "1960", "1962"}) do
		PA[type .. " " .. year] = {
			shield = format("PA-%%route%% (%s).svg", year),
			name = PA.SR.name.default,
			link = PA.SR.link,
			abbr = PA.SR.abbr,
			width = "square",
			bannersuffix = year
		}
	end
end

for _,type in ipairs({'SR', 'PA'}) do
	for _,auxType in ipairs({"Alt", "Bus", "Byp", "Conn", "Opt", "Scenic", "Spur", "Temp", "Truck"}) do
		local spec = PA[" aux "][auxType]
		PA[type .. "-" .. auxType] = {
			shield = PA[type].shield,
			name = "Pennsylvania Route %route% " .. spec.name,
			link = "Pennsylvania Route %route% " .. spec.name .. PA[" dab "],
			abbr = PA[type].abbr .. " " .. spec.abbrsuffix,
			banner = spec.bannerprefix .. " plate.svg",
			aux = spec.aux,
			width = "expand",
		}
	end
end

for _,type in ipairs({'SR', 'PA'}) do
	for _,year in ipairs({'1926', '1948'}) do
		for _,auxType in ipairs({"Alt", "Bus", "Byp", "Conn", "Opt", "Scenic", "Spur", "Temp", "Truck"}) do
			local type = type .. " " .. year
			local spec = PA[" aux "][auxType]
			PA[type .. "-" .. auxType] = {
				shield = PA[type].shield,
				name = "Pennsylvania Route %route% " .. spec.name,
				link = "Pennsylvania Route %route% " .. spec.name .. PA[" dab "],
				abbr = PA[type].abbr .. " " .. spec.abbrsuffix,
				banner = spec.bannerprefix .. " plate " .. year .. ".svg",
				bannersuffix = year,
				aux = spec.aux,
				width = "square",
			}
		end
	end
end

for _,type in ipairs({'SR', 'PA'}) do
	for _,year in ipairs({'1960'}) do
		for _,auxType in ipairs({"Alt", "Bus", "Byp", "Conn", "Opt", "Scenic", "Spur", "Temp", "Truck"}) do
			local type = type .. " " .. year
			local spec = PA[" aux "][auxType]
			PA[type .. "-" .. auxType] = {
				shield = PA[type].shield,
				name = "Pennsylvania Route %route% " .. spec.name,
				link = "Pennsylvania Route %route% " .. spec.name .. PA[" dab "],
				abbr = PA[type].abbr .. " " .. spec.abbrsuffix,
				banner = spec.bannerprefix .. " plate 1948.svg",
				bannersuffix = "1948",
				aux = spec.aux,
				width = "expand",
			}
		end
	end
end

for _,type in ipairs({'SR', 'PA'}) do
	for _,year in ipairs({'1962'}) do
		for _,auxType in ipairs({"Alt", "Bus", "Byp", "Conn", "Opt", "Scenic", "Spur", "Temp", "Truck"}) do
			local type = type .. " " .. year
			local spec = PA[" aux "][auxType]
			PA[type .. "-" .. auxType] = {
				shield = PA[type].shield,
				name = "Pennsylvania Route %route% " .. spec.name,
				link = "Pennsylvania Route %route% " .. spec.name .. PA[" dab "],
				abbr = PA[type].abbr .. " " .. spec.abbrsuffix,
				banner = spec.bannerprefix .. " plate 1961.svg",
				bannersuffix = "1961",
				aux = spec.aux,
				width = "expand",
			}
		end
	end
end

PA["SR-Truck-Alt"] = {
	shield = "PA-%route%.svg",
	name = "PA Route %route% Alternate Truck",
	link = "Pennsylvania Route %route% Alternate Truck [dab||(%dab%)|]",
	abbr = "PA&nbsp;%route% Alt. Truck",
	banner = "Alternate truck plate.svg",
	width = "expand",
	aux = PA[" aux "].Truck
}

PA["PA-Truck-Alt"] = PA["SR-Truck-Alt"]
PA["SR-Alt-Truck"] = PA["SR-Truck-Alt"]
PA["PA-Alt-Truck"] = PA["SR-Truck-Alt"]

PA.SBR = {
	shield = "PA Bike Route %route%.svg",
	name = "BicyclePA Route %route%",
	link = "BicyclePA Route %route%",
	abbr = "BicyclePA Route %route%",
	orientation = "upright"	
}

PA.QR = {
	shield = "",
	shieldmain = "PA QR %route%.svg",
	name = "State Route %route%",
	link = "",
	abbr = "SR&nbsp;%route%"
}

-- add new types above this line if you want it to have the state highway browse and maint
for k, v in pairs(PA) do if k:find ("^%a") then
	v.maint = "[[Pennsylvania Department of Transportation|PennDOT]]"
	end
end

for k, v in pairs(PA) do if k:find ("^%a+ %d") then 
	v.maint = "[[Pennsylvania Department of Highways]]"
	end
end

PA.PATP = {
	shield = "Pennsylvania Turnpike logo.svg",
    name = "Pennsylvania Turnpike",
    link = "Pennsylvania Turnpike",
    abbr = "Penna Turnpike",
    bannersuffix = "green",
    maint = [[Pennsylvania Turnpike Commission]]
}
PA.Turnpike = PA.PATP

PA.PANE = {
	shield = "Pennsylvania Turnpike logo.svg",
    name = "Pennsylvania Turnpike Northeast Extension",
    link = "Pennsylvania Turnpike Northeast Extension",
    abbr = "Penna Turnpike NE Extension",
    bannersuffix = "green",
    maint = PA.PATP.maint
}

PA.Toll = {
	shield = "Turnpike-%route%.svg",
	name = PA.SR.name.default,
    link = PA.SR.link,
    abbr = "PA&nbsp;Turnpike&nbsp;%route%",
    width = "expand",
    bannersuffix = "green"
}

PA["Toll2"] = {
	shield = "Turnpike-%route%.svg",
    link = PA.Toll.link,
    abbr = PA.Toll.abbr,
    width = PA.Toll.width,
    banner = "Toll plate yellow.svg",
    bannersuffix = "green"
}

PA["PA-Toll"] = {
	shield = "PA-Toll-%route%.svg",
	name = PA.SR.name.default .. " Toll",
    link = PA.SR.link,
    abbr = PA.SR.abbr .. " Toll",
    width = "expand",
}

PA.Belt = {
	shield = "Pittsburgh PA %route% Belt shield.svg",
    name = "%route% Belt",
    link = "%route% Belt (Pittsburgh)",
    abbr = "%route% Belt"
}

PA.DE = {alias = {module = "USA/DE", type = "DE"}}
PA.MD = {alias = {module = "USA/MD", type = "MD"}}
PA.NJ = {alias = {module = "USA/NJ", type = "NJ"}}
PA.NJTP = {alias = {module = "USA/NJ", type = "NJTP"}}
PA["I-NJ"] = {alias = {module = "USA/NJ", type = "I"}}

return PA