龟头炎用什么药治疗| 什么猪没有嘴| absolutvodka什么酒| 1999年发生了什么事| 后脑勺出汗是什么原因| cu是什么| ad什么时候吃最好| pth是什么| 1度房室传导阻滞是什么意思| 急性胆囊炎吃什么药| 什么人入什么| 左腹下方隐痛什么原因| 小孩吐奶是什么原因| ph值高是什么原因| 满月打什么疫苗| 阴茎中途疲软吃什么药| 甲状腺癌有什么症状| 检查食道挂什么科| 什么是湿热| 指示是什么意思| 血尿是什么颜色的| 小腿出汗是什么原因| 备孕前吃什么调理身体| 日本是什么时候投降的| 家里为什么会有跳蚤| 着痹是什么意思| 粘胶是什么面料| 积德是什么意思| 憩室什么意思| 说梦话是什么原因| 严重失眠吃什么药| 优越感是什么意思| 10月24日什么星座| 尿出红色的尿是什么原因| 户籍地址是什么意思| 红细胞偏高是什么原因| 不在服务区是什么意思| 胃胀是什么感觉| 身份证x代表什么意思| 十一月四日是什么星座| 7月25日是什么星座| 1989年五行属什么| 憋尿有什么危害| 梦到拉粑粑是什么意思| 为什么医生不建议献血小板| 湿热吃什么中成药| 浙江大学校长什么级别| 甲减长期服用优甲乐有什么危害| 眼袋浮肿什么原因| 鼻子有痣代表什么| 抓手是什么意思| 仰卧是什么姿势| 下午1点是什么时辰| ipv是什么疫苗| 打生长激素有什么危害和副作用| 生物学是什么| 拉稀拉水吃什么药管用| 体检转氨酶高是什么原因| 古埃及是什么人种| 空调滴水是什么原因| 弱水三千什么意思| 尼日利亚说什么语言| 什么是熬夜| 违拗是什么意思| 毛泽东的女儿为什么姓李| 什么颜色加什么颜色是红色| 今年是什么| 什么是禅| jf是什么警察| cm代表什么单位| 什么时候洗头是最佳时间| 三月十九是什么星座| 什么原因引起耳石症| 流产会出现什么症状| 懊恼是什么意思| 一花一草一世界的下一句是什么| 基础代谢率是什么意思| 越睡越困是什么原因| 右边脸疼是什么原因| 什么牌子的空调好| 烫伤挂什么科室| 脸上起疙瘩是什么原因| 为什么一躺下就头晕目眩| 耳鸣用什么滴耳液| andy是什么意思| 胃疼挂什么科| 摩羯男喜欢什么类型的女生| 梦见种玉米是什么意思| 解脲脲原体是什么病| 感冒挂什么科| 古人的婚礼在什么时候举行| 水逆退散什么意思| 气血亏虚什么症状| 什么水果不含糖| 乳房疼吃什么药| 流口水是什么原因引起的| 淡淡的什么| 皮革胃是什么意思| 为什么吃甲鱼不吃乌龟| 辣子鸡属于什么菜系| 6月5日是世界什么日| 受精卵发育成什么| 什么书没有字| 梦见买白菜是什么意思| 萎缩性胃炎吃什么水果好| 摧枯拉朽什么意思| 喝苏打水有什么好处| 五月十一是什么星座| 穿丝袜有什么好处| 大便出油是什么原因| 脂肪肝吃什么好| 背靠背什么意思| 什么呢| 西乐葆是什么药| 大排是什么肉| 水晶粉是什么粉| 1998属什么生肖| 10是什么意思| 深紫色配什么颜色好看| 大道无为是什么意思| 法院起诉离婚需要什么材料| 男性尿道炎吃什么药| 什么是飞秒手术| butterfly是什么意思| 月老叫什么名字| 高什么亮什么成语| 皮肤瘙痒用什么药| 肺炎挂什么科| 禁果什么意思| 天鹅吃什么| 老母鸡炖什么好吃又有营养价值| 紫萱名字的含义是什么| 什么叫野鸡大学| 左后脑勺疼是什么原因| 30岁以上适合用什么牌子的护肤品| 烧头七有什么讲究| 医院门特是什么意思| 核磁共振能检查什么| whoo是什么牌子| 十年什么婚| 为什么叫六小龄童| 硫黄是什么| 四月初八是什么节日| 红糖水什么时候喝| 榆木脑袋是什么意思| 天降横财什么意思| 骨质疏松是什么意思| 心脏彩超fs是什么意思| 九里香什么时候开花| 亚麻籽是什么植物| 吃什么补孕酮| 二级烫伤是什么程度| 脂蛋白a高有什么危害| 碳水化合物指的是什么食物| 司局级是什么级别| 仲夏夜是什么意思| 什么是紫癜| 为什么总是莫名其妙的想哭| 左腿发麻是什么原因| 什么金属最贵| 风热感冒吃什么药最好| 安睡裤是什么| 乳果糖是什么| 什么地指挥| 静脉曲张挂什么号| 艺高胆大是什么生肖| 淋巴细胞计数偏高是什么原因| 肩周炎口服什么药最好| 皮脂腺痣是什么原因引起的| 益生菌有什么功效| 捣碎东西的器皿叫什么| 刚怀孕吃什么好| 流鼻血挂什么科| pku什么意思| 售后服务是做什么的| 头疼想吐吃什么药| 苛捐杂税是什么生肖| 蜗牛吃什么食物| 什么话什么说| 嘉靖为什么不杀严嵩| 怀孕胎盘低有什么影响| 好事多磨什么意思| 黄酒是什么| legion什么牌子| 年终奖是什么意思| 为什么会得艾滋病| 世界上最大的湖泊是什么湖| 上环要做什么检查| 质体是什么| 尿道感染是什么原因引起| 梦见涨水是什么兆头| 五月二十二是什么星座| 筒骨炖什么好吃| 为什么会得纤维瘤| 吃什么降胆固醇| 308是什么意思| 鸡头米是什么东西| 氨基比林是什么药| 手抖吃什么药| 西游记是什么朝代| 走私是什么| lucy是什么意思| 脚后跟长痣有什么寓意| 女生胸痛什么原因| 农历七月初七俗称什么| 清影是什么意思| 五行属土缺命里缺什么| 郑中基为什么叫太子基| 脑供血不足吃什么| 轻食是什么| conch是什么牌子| 青蒿素是什么| 猫咪睡姿代表什么图解| 口巴念什么| 手发胀是什么原因造成的| 鹦鹉可以吃什么| 四大天王叫什么名字| 土耳其浴是什么意思| 孕妇梦见下雨是什么意思| 精分是什么| 抽动症是什么原因引起的| 粘米是什么米| 美特斯邦威是什么档次| 子宫多发肌瘤是什么意思| beryl是什么意思| 甲状腺球蛋白抗体高是什么原因| 农历六月十八是什么日子| 生理盐水有什么作用| 子宫饱满是什么意思| pmid是什么意思| 思密达韩语是什么意思| hpv39阳性是什么意思| 6月28日什么星座| 游丝是什么意思| 区法院院长是什么级别| 辅警是什么| 吃了就吐是什么原因| 杂合突变型是什么意思| 射手座和什么座最配| 黄瓜苦是什么原因| 虾滑是什么| 牛子是什么| 商业保险报销需要什么材料| 腰上长痘痘是什么原因| 汗疱疹用什么药膏最好| 交链孢霉过敏是什么| 免签国家是什么意思| 负重是什么意思| 回归线是什么| hcg偏高是什么原因| 深情什么意思| 6月23日是什么日子| 梦见春梦是什么意思| 尿毒症是什么| 甲状腺2类是什么意思| 黑素瘤早期什么症状| 游字五行属什么| 痰多吃什么好化痰| 总是拉肚子是什么原因| 什么是蜘蛛痣图片| 甘油三酯高是什么病| 吃什么补血小板效果最好| 口苦吃什么中成药| 本来无一物何处惹尘埃是什么意思| 百度Pojdi na vsebino

车讯:2017年1月发布 奥迪公布Q8概念车预告图

Iz Wikipedije, proste enciklopedije
百度 起底深圳延保系公司此次全国范围的风险排查,起因于监管部门对深圳延保系公司的大起底。
--[[
This module is intended to replace the functionality of {{Coord}} and related
templates.  It provides several methods, including

{{#Invoke:Coordinates | coord }} : General function formatting and displaying
coordinate values.

{{#Invoke:Coordinates | dec2dms }} : Simple function for converting decimal
degree values to DMS format.

{{#Invoke:Coordinates | dms2dec }} : Simple function for converting DMS format
to decimal degree format.

]]

math_mod = require( "Module:Math" );
globalFrame = nil

coordinates = {};

--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(coords)
	return mw.getCurrentFrame():extensionTag{
		name = 'indicator',
		args = { name = 'coordinates' },
		content = '<span id="coordinates">[[Geografski koordinatni sistem|Koordinati]]: ' .. coords .. '</span>'
	}
end


--[[ Helper function, Replacement for {{coord/display/inline}} ]]
function displayinline (s, notes)
    return s .. notes    
end

--[[ Helper function, used in detecting DMS formatting ]]
local dmsTest = function(first, second)
    local concatenated = first:upper() .. second:upper();
    
    if concatenated == "NE" or concatenated == "NW" or concatenated == "SE" or concatenated == "SW" or
        concatenated == "EN" or concatenated == "WN" or concatenated == "ES" or concatenated == "WS" then
        return true;
    end
    return false;
end

--[[
parseDec

Transforms decimal format latitude and longitude into the a
structure to be used in displaying coordinates
]]
function parseDec( lat, long, format )
    local coordinateSpec = {}
    local errors = {}
    
    if long == "" or long == nil then
        return nil, {{"parseDec", "Manjka longituda"}}
    end
    
    errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );    
    coordinateSpec["dec-lat"]  = lat;
    coordinateSpec["dec-long"] = long;

    local mode = coordinates.determineMode( lat, long );
    coordinateSpec["dms-lat"]  = convert_dec2dms( lat, "N", "S", mode)  -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}
    coordinateSpec["dms-long"] = convert_dec2dms( long, "E", "W", mode)  -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}    
    
    if format ~= "" then
        coordinateSpec.default = format
    else
        coordinateSpec.default = "dec"
    end

    return coordinateSpec, errors
end

--[[ Helper function, handle optional args. ]]
function optionalArg(arg, suplement)
    if arg ~= nil and arg ~= "" then
        return arg .. suplement
    end
    return ""
end

--[[
parseDMS

Transforms degrees, minutes, seconds format latitude and longitude 
into the a structure to be used in displaying coordinates
]]
function parseDMS( lat_d, lat_m, lat_s, lat_f, long_d, long_m, long_s, long_f, format )
    local coordinateSpec = {}
    local errors = {}
    
    lat_f = lat_f:upper();
    long_f = long_f:upper();
    
    -- Check if specified backward
    if lat_f == 'E' or lat_f == 'W' then
        local t_d, t_m, t_s, t_f;
        t_d = lat_d;
        t_m = lat_m;
        t_s = lat_s;
        t_f = lat_f;
        lat_d = long_d;
        lat_m = long_m;
        lat_s = long_s;
        lat_f = long_f;
        long_d = t_d;
        long_m = t_m;
        long_s = t_s;
        long_f = t_f;
    end    
    
    errors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );
    if long_d == nil or long_d == "" then
        table.insert(errors, {"parseDMS", "Manjka longituda" })
    end
    
    if lat_m == nil and lat_s == nil and long_m == nil and long_s == nil and #errors == 0 then 
        if math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 then
            if lat_f:upper() == 'S' then 
                lat_d = '-' .. lat_d;
            end
            if long_f:upper() == 'W' then 
                long_d = '-' .. long_d;
            end     
            
            return parseDec( lat_d, long_d, format );
        end        
    end   
    
    coordinateSpec["dms-lat"]  = lat_d.."°"..optionalArg(lat_m,"′") .. optionalArg(lat_s,"″") .. lat_f
    coordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′") .. optionalArg(long_s,"″") .. long_f
    coordinateSpec["dec-lat"]  = convert_dms2dec(lat_f, lat_d, lat_m, lat_s) -- {{coord/dms2dec|{{{4}}}|{{{1}}}|0{{{2}}}|0{{{3}}}}}
    coordinateSpec["dec-long"] = convert_dms2dec(long_f, long_d, long_m, long_s) -- {{coord/dms2dec|{{{8}}}|{{{5}}}|0{{{6}}}|0{{{7}}}}}

    if format ~= "" then
        coordinateSpec.default = format
    else
        coordinateSpec.default = "dms"
    end   

    return coordinateSpec, errors
end

--[[
specPrinter

Output formatter.  Takes the structure generated by either parseDec
or parseDMS and formats it for inclusion on Wikipedia.
]]
function specPrinter(args, coordinateSpec)
    local uriComponents = coordinateSpec["param"]
    if uriComponents == "" then
        -- RETURN error, should never be empty or nil
        return "ERROR param was empty"
    end
    if args["name"] ~= "" and args["name"] ~= nil then
        uriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])
    end
    
    local geodmshtml = '<span class="geo-dms" title="Zemljevidi, zra?ni posnetki in drugi podatki o tej lokaciji">'
             .. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
             .. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
             .. '</span>'

    local lat = tonumber( coordinateSpec["dec-lat"] ) or 0
    if lat < 0 then
        -- FIXME this breaks the pre-existing precision
        geodeclat = coordinateSpec["dec-lat"]:sub(2) .. "°S"
    else
        geodeclat = (coordinateSpec["dec-lat"] or 0) .. "°N"
    end

    local long = tonumber( coordinateSpec["dec-long"] ) or 0
    if long < 0 then
        -- FIXME does not handle unicode minus
        geodeclong = coordinateSpec["dec-long"]:sub(2) .. "°W"
    else
        geodeclong = (coordinateSpec["dec-long"] or 0) .. "°E"
    end
    
    local geodechtml = '<span class="geo-dec" title="Zemljevidi, zra?ni posnetki in drugi podatki o tej lokaciji">'
             .. geodeclat .. ' '
             .. geodeclong
             .. '</span>'

    local geonumhtml = '<span class="geo">'
             .. coordinateSpec["dec-lat"] .. '; '
             .. coordinateSpec["dec-long"]
             .. '</span>'

    local inner;
    inner = '<span class="' .. displayDefault(coordinateSpec["default"], "dms" ) .. '">' .. geodmshtml .. '</span>'
                .. '<span class="geo-multi-punct">&#xfeff; / &#xfeff;</span>'
                .. '<span class="' .. displayDefault(coordinateSpec["default"], "dec" ) .. '">';

    if args["name"] == "" or args["name"] == nil then
        inner = inner .. geodechtml 
                .. '<span style="display:none">&#xfeff; / ' .. geonumhtml .. '</span></span>'
    else
        inner = inner .. '<span class="vcard">' .. geodechtml 
                .. '<span style="display:none">&#xfeff; / ' .. geonumhtml .. '</span>'
                .. '<span style="display:none">&#xfeff; (<span class="fn org">'
                .. args["name"] .. '</span>)</span></span></span>'
    end

    return '<span class="plainlinks nourlexpansion">' .. globalFrame:preprocess(
        '[//tools.wmflabs.org/geohack/geohack.php?pagename={{FULLPAGENAMEE}}&params=' ..
        uriComponents .. ' ' .. inner .. ']') .. '</span>'
end

--[[
Formats any error messages generated for display
]]
function errorPrinter(errors)
    local result = ""
    for i,v in ipairs(errors) do
        local errorHTML = '<strong class="error">Koordinati: ' .. v[2] .. '</strong>'
        result = result .. errorHTML .. "<br />"
    end
    return result
end

--[[
Determine the required CSS class to display coordinates

Usually geo-nondefault is hidden by CSS, unless a user has overridden this for himself
default is the mode as specificied by the user when calling the {{coord}} template
mode is the display mode (dec or dms) that we will need to determine the css class for 
]]
function displayDefault(default, mode)
    if default == "" then
        default = "dec"
    end
    
    if default == mode then
        return "geo-default"
    else
        return "geo-nondefault"
    end
end

--[[ 
Check the input arguments for coord to determine the kind of data being provided
and then make the necessary processing.
]]
function formatTest(args)
    local result, errors;
    local primary = false;
    
    if args[1] == "" then
        -- no lat logic
        return errorPrinter( {{"formatTest", "Manjka latituda"}} )
    elseif args[4] == "" and args[5] == "" and args[6] == "" then
        -- dec logic
        result, errors = parseDec( args[1], args[2], args['format'] )
        if result == nil then
            return errorPrinter( errors );
        end              
        result.param    = table.concat( {args[1], "_N_", args[2], "_E_", args[3] } );
    elseif dmsTest(args[4], args[8]) then
        -- dms logic
        result, errors = parseDMS( args[1], args[2], args[3], args[4], 
            args[5], args[6], args[7], args[8], args['format'] )
        result.param = table.concat( { args[1], args[2], args[3], args[4], args[5],
            args[6], args[7], args[8], args[9] } , '_' );
        if args[10] ~= '' then
            table.insert( errors, { 'formatTest', 'Dodatni nepri?akovani parametri' } );
        end        
    elseif dmsTest(args[3], args[6]) then
        -- dm logic
        result, errors = parseDMS( args[1], args[2], nil, args[3], 
            args[4], args[5], nil, args[6], args['format'] )
        result.param = table.concat( { args[1], args[2], args[3], args[4], args[5],
            args[6], args[7] } , '_' );
        if args[8] ~= '' then
            table.insert( errors, { 'formatTest', 'Dodatni nepri?akovani parametri' } );
        end        
    elseif dmsTest(args[2], args[4]) then
        -- d logic
        result, errors = parseDMS( args[1], nil, nil, args[2], 
            args[3], nil, nil, args[4], args['format'] )
        result.param = table.concat( { args[1], args[2], args[3], args[4], args[5] } , '_' );
        if args[6] ~= '' then
            table.insert( errors, { 'formatTest', 'Dodatni nepri?akovani parametri' } );
        end        
    else
        -- Error
        return errorPrinter( {{"formatTest", "Neprepoznana uporaba parametrov"}} )
    end
    result.name     = args["name"]
    
    local extra_param = {'dim', 'globe', 'scale', 'region', 'source', 'type'}
    for _, v in ipairs( extra_param ) do
        if (args[v] or '') ~= '' then 
            table.insert( errors, {'formatTest', 'Parameter: "' .. v .. '=" bi moral biti "' .. v .. ':"' } );
        end
    end
    
    if #errors == 0 then
        return specPrinter( args, result )    
    else
        return specPrinter( args, result ) .. " " .. errorPrinter(errors) .. '[[Kategorija:Strani z napa?no oblikovanimi koordinatami]]'; 
    end    
end

--[[ 
Helper function, convert decimal latitude or longitude to 
degrees, minutes, and seconds format based on the specified precision.  
]]
function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
    local coord = tonumber(coordinate) or 0
    local postfix
    if coord >= 0 then
        postfix = firstPostfix
    else
        postfix = secondPostfix
    end

    precision = precision:lower();
    if precision == "dms" then
        return convert_dec2dms_dms( math.abs( coord ) ) .. postfix;
    elseif precision == "dm" then
        return convert_dec2dms_dm( math.abs( coord ) ) .. postfix;
    elseif precision == "d" then
        return convert_dec2dms_d( math.abs( coord ) ) .. postfix;
    end
end

--[[ Helper function, convert decimal to degrees ]]
function convert_dec2dms_d(coordinate)
    local d = math_mod._round( coordinate, 0 ) .. "°"
    return d .. ""
end

--[[ Helper function, convert decimal to degrees and minutes ]]
function convert_dec2dms_dm(coordinate)    
    coordinate = math_mod._round( coordinate * 60, 0 );
    local m = coordinate % 60;
    coordinate = math.floor( (coordinate - m) / 60 );
    local d = coordinate % 360 .."°"
    
    return d .. string.format( "%02d′", m )
end

--[[ Helper function, convert decimal to degrees, minutes, and seconds ]]
function convert_dec2dms_dms(coordinate)
    coordinate = math_mod._round( coordinate * 60 * 60, 0 );
    local s = coordinate % 60
    coordinate = math.floor( (coordinate - s) / 60 );
    local m = coordinate % 60
    coordinate = math.floor( (coordinate - m) / 60 );
    local d = coordinate % 360 .."°"

    return d .. string.format( "%02d′", m ) .. string.format( "%02d″", s )
end

--[[
Convert DMS format into a N or E decimal coordinate
]]
function convert_dms2dec(direction, degrees_str, minutes_str, seconds_str)
    local degrees = tonumber(degrees_str) or 0
    local minutes = tonumber(minutes_str) or 0
    local seconds = tonumber(seconds_str) or 0
    
    local factor
    if direction == "N" or direction == "E" then
        factor = 1
    else
        factor = -1
    end
    
    local precision = 0
    if seconds_str ~= nil and seconds_str ~= '' then
        precision = 5 + math.max( math_mod._precision(seconds_str), 0 );
    elseif minutes_str ~= nil and minutes_str ~= '' then
        precision = 3 + math.max( math_mod._precision(minutes_str), 0 );
    else
        precision = math.max( math_mod._precision(degrees_str), 0 );
    end
    
    local decimal = factor * (degrees+(minutes+seconds/60)/60) 
    return string.format( "%." .. precision .. "f", decimal ) -- not tonumber since this whole thing is string based.
end

--[[ 
Checks input values to for out of range errors.
]]
function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong )
    local errors = {};
    lat_d = tonumber( lat_d ) or 0;
    lat_m = tonumber( lat_m ) or 0;
    lat_s = tonumber( lat_s ) or 0;
    long_d = tonumber( long_d ) or 0;
    long_m = tonumber( long_m ) or 0;
    long_s = tonumber( long_s ) or 0;

    if strong then
        if lat_d < 0 then
            table.insert(errors, {source, "stopinje latitude < 0 with hemisphere flag"})
        end
        if long_d < 0 then
            table.insert(errors, {source, "stopinje longitude < 0 with hemisphere flag"})
        end
        --[[ 
        #coordinates is inconsistent about whether this is an error.  If globe: is
        specified, it won't error on this condition, but otherwise it will.
        
        For not simply disable this check.
        
        if long_d > 180 then
            table.insert(errors, {source, "stopinje longitude > 180 with hemisphere flag"})
        end
        ]]
    end    
        
    if lat_d > 90 then
        table.insert(errors, {source, "stopinje latitude > 90"})
    end
    if lat_d < -90 then
        table.insert(errors, {source, "stopinje latitude < -90"})
    end
    if lat_m >= 60 then
        table.insert(errors, {source, "minute latitude >= 60"})
    end
    if lat_m < 0 then
        table.insert(errors, {source, "minute latitude < 0"})
    end
    if lat_s >= 60 then
        table.insert(errors, {source, "sekunde latitude >= 60"})
    end
    if lat_s < 0 then
        table.insert(errors, {source, "sekunde latitude < 0"})
    end
    if long_d >= 360 then
        table.insert(errors, {source, "stopinje longitude >= 360"})
    end
    if long_d <= -360 then
        table.insert(errors, {source, "stopinje longitude <= -360"})
    end
    if long_m >= 60 then
        table.insert(errors, {source, "minute longitude >= 60"})
    end
    if long_m < 0 then
        table.insert(errors, {source, "minute longitude < 0"})
    end
    if long_s >= 60 then
        table.insert(errors, {source, "sekunde longitude >= 60"})
    end
    if long_s < 0 then
        table.insert(errors, {source, "sekunde longitude < 0"})
    end
    
    return errors;
end

--[[
dec2dms

Wrapper to allow templates to call dec2dms directly.

Usage:
    {{ Invoke:Coordinates | dec2dms | decimal_coordinate | positive_suffix | 
        negative_suffix | precision }}
    
decimal_coordinate is converted to DMS format.  If positive, the positive_suffix
is appended (typical N or E), if negative, the negative suffix is appended.  The
specified precision is one of 'D', 'DM', or 'DMS' to specify the level of detail
to use.
]]
function coordinates.dec2dms(frame)
    globalFrame = frame
    local coordinate = frame.args[1]
    local firstPostfix = frame.args[2]
    local secondPostfix = frame.args[3]
    local precision = frame.args[4]

    return convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)
end

--[[
Helper function to determine whether to use D, DM, or DMS
format depending on the precision of the decimal input.
]]
function coordinates.determineMode( value1, value2 )
    local precision = math.max( math_mod._precision( value1 ), math_mod._precision( value2 ) );
    if precision <= 0 then
        return 'd'
    elseif precision <= 2 then
        return 'dm';
    else
        return 'dms';
    end
end        

--[[
dms2dec

Wrapper to allow templates to call dms2dec directly.

Usage:
    {{ Invoke:Coordinates | dms2dec | direction_flag | degrees | 
        minutes | seconds }}
    
Converts DMS values specified as degrees, minutes, seconds too decimal format.
direction_flag is one of N, S, E, W, and determines whether the output is 
positive (i.e. N and E) or negative (i.e. S and W).
]]
function coordinates.dms2dec(frame)
    globalFrame = frame
    local direction = frame.args[1]
    local degrees = frame.args[2]
    local minutes = frame.args[3]
    local seconds = frame.args[4]

    return convert_dms2dec(direction, degrees, minutes, seconds)
end

--[[
coord

Main entry point for Lua function to replace {{coord}}

Usage:
    {{ Invoke:Coordinates | coord }}
    {{ Invoke:Coordinates | coord | lat | long }}
    {{ Invoke:Coordinates | coord | lat | lat_flag | long | long_flag }}
    ...
    
    Refer to {{coord}} documentation page for many additional parameters and 
    configuration options.
    
Note: This function provides the visual display elements of {{coord}}.  In
order to load coordinates into the database, the {{#coordinates:}} parser 
function must also be called, this is done automatically in the Lua
version of {{coord}}.
]]
function coordinates.coord(frame)
    globalFrame = frame
    local args = frame.args
    if args[1] == nil then
        local pFrame = frame:getParent();
        args = pFrame.args;
        for k,v in pairs( frame.args ) do
            args[k] = v;
        end
    end
    
    for i=1,10 do 
        if args[i] == nil then 
            args[i] = ""
        else
            args[i] = args[i]:match( '^%s*(.-)%s*$' );  --remove whitespace
        end        
    end
    args['format'] = args['format'] or '';
    
    local contents = formatTest(args)
    local Notes = args.notes or ""
    local Display = string.lower(args.display or "inline")
    if Display == '' then
        Display = 'inline';
    end
    
    local text = ''
    if string.find( Display, 'inline' ) ~= nil or Display == 'i' or 
            Display == 'it' or Display == 'ti' then
        text = displayinline(contents, Notes)
    end
    if string.find( Display, 'title' ) ~= nil or Display == 't' or 
            Display == 'it' or Display == 'ti' then
        text = text .. displaytitle(contents, Notes)
    end
    return text
end

function coordinates.coordinsert(frame)
	for i, v in ipairs(frame.args) do
		if i ~= 1 then
			if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then 
				frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
			end
		end
	end
	if frame.args.name then
		if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
			local namestr = frame.args.name
			frame.args[1] = mw.ustring.gsub(frame.args[1], 
				'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)', 
				'%1<span class="vcard">%2<span style="display:none">&#xfeff; (<span class="fn org">' .. namestr .. '</span>)</span></span>%3')
			frame.args[1] = mw.ustring.gsub(frame.args[1], '(&params=[^&"<>%[%] ]*) ', '%1&title=' .. mw.uri.encode(namestr) .. ' ')
		end
	end
	return frame.args[1]
end

return coordinates
什么是打飞机 翡翠什么样的好 消渴病是什么病 月经褐色是什么原因 睡觉做噩梦是什么原因
wtf是什么意思 不应期是什么意思 脚拇指外翻是什么原因造成的 身体出现白斑有可能患什么病 食管裂孔疝什么意思
头晕是什么原因 脖子长痘痘是因为什么原因 一什么桌子 10086查话费发什么短信 突然戒烟对身体有什么影响
肉毒为什么怕热敷 sam是什么意思 腾冲有什么好玩的景点 姨妈期间可以吃什么水果 骨密度高是什么意思
牙齿痛吃什么药好hcv7jop6ns4r.cn 生是什么生肖hcv8jop6ns3r.cn 10月11是什么星座hcv8jop0ns1r.cn 臭鳜鱼是什么菜系hcv8jop5ns1r.cn 金匮肾气丸有什么功效hcv8jop4ns3r.cn
产后抑郁症有什么表现症状hcv9jop2ns2r.cn 愣头青是什么意思hcv7jop9ns5r.cn 6度醋与9度有什么区别hcv9jop7ns2r.cn 吕布为什么叫三姓家奴hcv7jop4ns8r.cn 减肥吃什么零食hcv8jop7ns6r.cn
为什么会得经期综合症hcv8jop6ns4r.cn 我看见了什么hcv8jop5ns0r.cn 小三阳吃什么药能转阴hcv9jop0ns7r.cn 龙和什么属相最配hcv9jop1ns5r.cn 什么虫子咬了像针扎一样疼hcv9jop5ns9r.cn
请节哀是什么意思hanqikai.com 痔疮吃什么好hcv8jop4ns9r.cn 静脉曲张用什么药好hcv8jop4ns3r.cn 工装是什么hcv7jop5ns0r.cn 太阳穴长痘痘什么原因hcv8jop2ns2r.cn
百度