Jump to content

Module:Cite LADOTD map: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Created module
 
No edit summary
Line 9: Line 9:
--Various parishes need special treatment to handle spaces and/or punctuation.
--Various parishes need special treatment to handle spaces and/or punctuation.
if parish == "East Baton Rouge" then
if parish == "De Soto" then
parishProcessed = "EastBatonRouge"
parishProcessed = "DeSoto"
elseif parish == "East Baton Rouge" then
parishProcessed = "East_Baton_Rouge"
elseif parish == "East Carroll" then
elseif parish == "East Carroll" then
parishProcessed = "EastCarroll"
parishProcessed = "East_Carroll"
elseif parish == "East Feliciana" then
elseif parish == "East Feliciana" then
parishProcessed = "EastFeliciana"
parishProcessed = "East_Feliciana"
elseif parish == "Jefferson Davis" then
elseif parish == "Jefferson Davis" then
parishProcessed = "JeffersonDavis"
parishProcessed = "Jefferson_Davis"
elseif parish == "La Salle" then
elseif parish == "La Salle" then
parishProcessed = "LaSalle"
parishProcessed = "LaSalle"
elseif parish == "Pointe Coupee" then
elseif parish == "Pointe Coupee" then
parishProcessed = "Pointe Coupee"
parishProcessed = "Pointe_Coupee"
elseif parish == "Red River" then
elseif parish == "Red River" then
parishProcessed = "RedRiver"
parishProcessed = "Red_River"
elseif parish == "St. Bernard" then
elseif parish == "St. Bernard" then
parishProcessed = "StBernard"
parishProcessed = "St_Bernard"
elseif parish == "St. Charles" then
elseif parish == "St. Charles" then
parishProcessed = "StCharles"
parishProcessed = "St_Charles"
elseif parish == "St. Helena" then
elseif parish == "St. Helena" then
parishProcessed = "StHelena"
parishProcessed = "St_Helena"
elseif parish == "St. James" then
elseif parish == "St. James" then
parishProcessed = "StJames"
parishProcessed = "St_James"
elseif parish == "St. John the Baptist" then
elseif parish == "St. John the Baptist" then
parishProcessed = "StJohntheBaptist"
parishProcessed = "St_JohntheBaptist"
elseif parish == "St. Landry" then
elseif parish == "St. Landry" then
parishProcessed = "StLandry"
parishProcessed = "St_Landry"
elseif parish == "St. Martin" then
elseif parish == "St. Martin" then
parishProcessed = "StMartin"
parishProcessed = "St_Martin"
elseif parish == "St. Mary" then
elseif parish == "St. Mary" then
parishProcessed = "StMary"
parishProcessed = "St_Mary"
elseif parish == "St. Tammany" then
elseif parish == "St. Tammany" then
parishProcessed = "StTammany"
parishProcessed = "St_Tammany"
elseif parish == "West Baton Rouge" then
elseif parish == "West Baton Rouge" then
parishProcessed = "WestBatonRouge"
parishProcessed = "West_Baton_Rouge"
elseif parish == "West Carroll" then
elseif parish == "West Carroll" then
parishProcessed = "WestCarroll"
parishProcessed = "West_Carroll"
elseif parish == "West Feliciana" then
elseif parish == "West Feliciana" then
parishProcessed = "WestFeliciana"
parishProcessed = "West_Feliciana"
else
else
parishProcessed = parish
parishProcessed = parish

Revision as of 13:49, 5 June 2017

local p = { } --Package to be exported

function p.url(frame)
	--This function builds URLs.
	local pframe = frame:getParent() --get arguments passed to the template
	local args = pframe.args
	local parish = args['parish'] or '' --this string holds the raw parish name
	local parishProcessed --this string holds the processed parish name to be added to the URL
	
	--Various parishes need special treatment to handle spaces and/or punctuation.
	if parish == "De Soto" then
		parishProcessed = "DeSoto"
	elseif parish == "East Baton Rouge" then
		parishProcessed = "East_Baton_Rouge"
	elseif parish == "East Carroll" then
		parishProcessed = "East_Carroll"
	elseif parish == "East Feliciana" then
		parishProcessed = "East_Feliciana"
	elseif parish == "Jefferson Davis" then
		parishProcessed = "Jefferson_Davis"
	elseif parish == "La Salle" then
		parishProcessed = "LaSalle"
	elseif parish == "Pointe Coupee" then
		parishProcessed = "Pointe_Coupee"
	elseif parish == "Red River" then
		parishProcessed = "Red_River"
	elseif parish == "St. Bernard" then
		parishProcessed = "St_Bernard"
	elseif parish == "St. Charles" then
		parishProcessed = "St_Charles"
	elseif parish == "St. Helena" then
		parishProcessed = "St_Helena"
	elseif parish == "St. James" then
		parishProcessed = "St_James"
	elseif parish == "St. John the Baptist" then
		parishProcessed = "St_JohntheBaptist"
	elseif parish == "St. Landry" then
		parishProcessed = "St_Landry"
	elseif parish == "St. Martin" then
		parishProcessed = "St_Martin"
	elseif parish == "St. Mary" then
		parishProcessed = "St_Mary"
	elseif parish == "St. Tammany" then
		parishProcessed = "St_Tammany"
	elseif parish == "West Baton Rouge" then
		parishProcessed = "West_Baton_Rouge"
	elseif parish == "West Carroll" then
		parishProcessed = "West_Carroll"
	elseif parish == "West Feliciana" then
		parishProcessed = "West_Feliciana"
	else
		parishProcessed = parish
	end
	
	local date = p.date(frame)
	if date == "2012P" then
		return "http://wwwsp.dotd.la.gov/Inside_LaDOTD/Divisions/Multimodal/Data_Collection/Mapping/Parish%20Maps/" .. parishProcessed
	end
end

return p