Content deleted Content added
define functions for entire file |
misc cleanup |
||
Line 164:
-- first caclulate e,n
-- computing e and n exactly, to get SW corner of box
local ne = northeast(lett,num
if ne.err then
return {region="GB",err=ne.err}
Line 261:
-- first caclulate e,n
-- computing e and n exactly, to get SW corner of box
local ne = northeast(lett,num
if ne.err then
return {region="IE", err=ne.err}
Line 279:
local function NGR2LL(ngr)
local result = {}
ngr, _ = mw.ustring.gsub(mw.ustring.upper(ngr),"[%s%p]","")
local first, last, lett, num = mw.ustring.find(ngr,"^([A-Z]+)(%d+)$")
if first == nil or empty(lett) or empty(num) or mw.ustring.len(lett) > 2 then
Line 301:
local function trim(s)
s, _ = mw.ustring.gsub(s,"^%s+","")
s, _ = mw.ustring.gsub(s,"%s+$","")
return s
end
Line 329:
local linktitle = args[2]
local namearg = args["name"]
local rawurl = yesno(args["rawurl"])
local args = split(input,'_')
local LL
Line 365:
-- https://geohack.toolforge.org/geohack.php?pagename=Mount_Whitney¶ms=36.578580925_N_118.29199495_W_type:mountain_region:US-CA_scale:100000_source:NGS
local url = ''
if not
url = url..'['
end
Line 394:
url = url .. "&title=" .. mw.uri.encode(namearg)
end
if not
url = url..' '..linktitle..']'
end
|