Модуль:Coordinates
Для документации этого модуля может быть создана страница Модуль:Coordinates/doc
--[[This module is intended to replace the functionality of {{Coord}} and relatedtemplates. It provides several methods, including{{#Invoke:Coordinates | coord }} : General function formatting and displayingcoordinate values.{{#Invoke:Coordinates | dec2dms }} : Simple function for converting decimaldegree values to DMS format.{{#Invoke:Coordinates | dms2dec }} : Simple function for converting DMS formatto decimal degree format.]]math_mod = require( "Module:Math" );globalFrame = nilcoordinates = {};local globe_list = '||earth|mercury|venus|moon|mars|phobos|deimos|ganymede|callisto|io|europa|mimas|enceladus|tethys|dione|rhea|titan|hyperion|iapetus|phoebe|miranda|ariel|umbriel|titania|oberon|triton|pluto|ceres|vesta|'local Dispay = '';--[[ Helper function, replacement for {{coord/display/title}} ]]function displaytitle (s, notes, globalFrame)return globalFrame:extensionTag{name = 'indicator',content = s .. notes,args = { name = '0-coord' }};end--[[ Helper function, Replacement for {{coord/display/inline}} ]]function displayinline (s, notes)return s .. notesend--[[ 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" orconcatenated == "EN" or concatenated == "WN" or concatenated == "ES" or concatenated == "WS" thenreturn true;endreturn false;end--[[parseDecTransforms decimal format latitude and longitude into the astructure to be used in displaying coordinates]]function parseDec( lat, long, format )local coordinateSpec = {}local errors = {}errors = validate( lat, nil, nil, long, nil, nil, 'parseDec', false );if #errors ~= 0 thenreturn nil, errorsendcoordinateSpec["dec-lat"] = lat;coordinateSpec["dec-long"] = long;local mode = coordinates.determineMode( lat, long );coordinateSpec["dms-lat"] = convert_dec2dms( lat, " с. ш.", " ю. ш.", mode) -- {{coord/dec2dms|{{{1}}}|N|S|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}coordinateSpec["dms-long"] = convert_dec2dms( long, " в. д.", " з. д.", mode) -- {{coord/dec2dms|{{{2}}}|E|W|{{coord/prec dec|{{{1}}}|{{{2}}}}}}}if format ~= "" thencoordinateSpec.default = formatelsecoordinateSpec.default = "dms"endreturn coordinateSpec, errorsend--[[ Helper function, handle optional args. ]]function optionalArg(arg, suplement, bool)if arg ~= nil and arg ~= "" then arg = (tonumber( arg ) % 1 == 0 or not bool) and string.format( "%02d", arg ) or string.format( "%02.2f", arg):gsub('%.', ',')return arg .. suplementendreturn ""end--[[parseDMSTransforms degrees, minutes, seconds format latitude and longitudeinto 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 backwardif lat_f == 'E' or lat_f == 'W' thenlocal 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;enderrors = validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, 'parseDMS', true );if #errors ~= 0 thenreturn nil, errorsendcoordinateSpec["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 lat_m == nil and lat_s == nil and long_m == nil and long_s == nil and #errors == 0 or math_mod._precision( lat_d ) > 0 or math_mod._precision( long_d ) > 0 thenif lat_f:upper() == 'S' thenlat_d = '-' .. lat_d;lat_f = " ю. ш.";elselat_f = " с. ш.";endif long_f:upper() == 'W' thenlong_d = '-' .. long_d;long_f = " з. д.";elselong_f = " в. д.";endreturn parseDec( lat_d, long_d, format );endif lat_f:upper() == 'S' thenlat_f = " ю. ш.";elselat_f = " с. ш.";endif long_f:upper() == 'E' thenlong_f = " в. д.";elselong_f = " з. д.";endif lat_s == '0' and long_s == '0' thenlat_s, long_s = nil, nilif lat_m == '0' and long_m == '0' thenlat_m, long_m = nil, nilendendcoordinateSpec["dms-lat"] = lat_d.."°"..optionalArg(lat_m,"′", true) .. optionalArg(lat_s,"″") .. lat_fcoordinateSpec["dms-long"] = long_d.."°"..optionalArg(long_m,"′", true) .. optionalArg(long_s,"″") .. long_fif format ~= "" thencoordinateSpec.default = formatelsecoordinateSpec.default = "dms"endreturn coordinateSpec, errorsend--[[splitParamSplit the parameter string and convert it into an object.]]function splitParam( param )local out = {}for pair in mw.text.gsplit( param, '_', true ) dolocal keyValue = mw.text.split( pair, ':', true )if #keyValue == 2 thenout[keyValue[1]] = keyValue[2]endendreturn outend--[[specPrinterOutput formatter. Takes the structure generated by either parseDecor parseDMS and formats it for inclusion on Wikipedia.]]function specPrinter(args)local coordinateSpec, errors = formatTest(args)if coordinateSpec == nil thenreturn errorsendlocal param = coordinateSpec["param"] .. '_' .. coordinateSpec["extra_param"]local uriComponents = paramif uriComponents == "" then-- RETURN error, should never be empty or nilreturn "Ошибка: не задан param"endif args["name"] ~= "" and args["name"] ~= nil thenuriComponents = uriComponents .. "&title=" .. mw.uri.encode(coordinateSpec["name"])endlocal text = ''local lat = tonumber( coordinateSpec["dec-lat"] ) or 0if lat < 0 then-- FIXME this breaks the pre-existing precisiongeodeclat = coordinateSpec["dec-lat"]:sub(2):gsub('%.', ',') .. "° ю. ш."elsegeodeclat = (coordinateSpec["dec-lat"]:gsub('%.', ',') or 0) .. "° с. ш."endlocal long = tonumber( coordinateSpec["dec-long"] ) or 0if long < 0 then-- FIXME does not handle unicode minusgeodeclong = coordinateSpec["dec-long"]:sub(2):gsub('%.', ',') .. "° з. д."elsegeodeclong = (coordinateSpec["dec-long"]:gsub('%.', ',') or 0) .. "° в. д."endlocal geodmshtml = '<span class="geo-dms" title="Различные карты и схемы для этого места">' .. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> ' .. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>' .. '</span>'local geodechtml = '<span class="geo-dec" title="Различные карты и схемы для этого места">' .. geodeclat .. ' ' .. geodeclong .. '</span>'local geonumhtml = '<span class="geo">' .. coordinateSpec["dec-lat"] .. '; ' .. coordinateSpec["dec-long"] .. '</span>'local inner;inner = '<span class="geo-geo-' .. coordinateSpec.default .. '"><span class="geo-dms">' .. geodmshtml .. '</span>'.. '<span class="geo-multi-punct"> / </span>'.. '<span class="geo-dec">';if args["name"] == "" or args["name"] == nil theninner = inner .. geodechtml.. '<span style="display:none"> / ' .. geonumhtml .. '</span></span></span>'elseinner = inner .. '<span class="vcard">' .. geodechtml.. '<span style="display:none"> / ' .. geonumhtml .. '</span>'.. '<span style="display:none"> (<span class="fn org">'.. args["name"] .. '</span>)</span></span></span></span>'endlocal params = splitParam( param )local type = string.gsub( string.lower( params.type or '' ), '%(.+$', '' )local scaleif args.scale and args.scale ~= '' thenscale = tonumber( args.scale )endif not scale thenlocal typeScale = {adm1st = 1000000,adm2nd = 300000,adm3rd = 100000,airport = 30000,city = 100000,country = 10000000,edu = 10000,event = 50000,forest = 50000,glacier = 50000,isle = 100000,landmark = 10000,mountain = 100000,pass = 10000,railwaystation = 10000,river = 100000,satellite = 10000000,waterbody = 100000,camera = 10000}if typeScale[type] thenscale = typeScale[type]elsescale = 30000endendif scale < 2000 then zoom = 18elseif scale < 5000 then zoom = 17elseif scale < 10000 then zoom = 16elseif scale < 20000 then zoom = 15elseif scale < 40000 then zoom = 14elseif scale < 80000 then zoom = 13elseif scale < 160000 then zoom = 12elseif scale < 320000 then zoom = 11elseif scale < 640000 then zoom = 10elseif scale < 1280000 then zoom = 9elseif scale < 2560000 then zoom = 8elseif scale < 5120000 then zoom = 7elseif scale < 10240000 then zoom = 6elseif scale < 20480000 then zoom = 5elseif scale < 40960000 then zoom = 4else zoom = 3endif coordinateSpec.default == 'dec' thentext = geodeclat .. ' ' .. geodeclongelsetext = coordinateSpec["dms-lat"] .. ' ' .. coordinateSpec["dms-long"]endlocal maplinkArgs = {['latitude'] = coordinateSpec['dec-lat'],['longitude'] = coordinateSpec['dec-long'],['zoom'] = zoom,['text'] = text,['title'] = mw.title.getCurrentTitle().text,['lang'] = 'ru'}if coordinateSpec['name'] and coordinateSpec['name'] ~= '' thenmaplinkArgs['title'] = coordinateSpec['name']endlocal maplinkMarkerSymbol = 'star'local markerSymbols = {adm1st = 'city',adm2nd = 'city',adm3rd = 'city',airport = 'airport',city = 'city',country = 'city',edu = 'college',forest = 'park',glacier = 'mountain',mountain = 'mountain',pass = 'mountain',railwaystation = 'rail',river = 'water',satellite = 'rocket',waterbody = 'water',camera = 'attraction'}if markerSymbols[type] thenmaplinkMarkerSymbol = markerSymbols[type]endlocal maplinkContent = [[ {"type": "Feature","geometry": {"type": "Point","coordinates": []] .. coordinateSpec['dec-long'] .. [[,]] .. coordinateSpec['dec-lat'] .. [[]},"properties": {"title": "]] .. mw.text.encode( maplinkArgs['title'] ) .. [[","marker-symbol": "]] .. maplinkMarkerSymbol .. [[","marker-color": "#3366cc"}} ]];local entityId = mw.wikibase.getEntityIdForCurrentPage()if entityId thenmaplinkContent = maplinkContent .. [[, {"type": "ExternalData","service": "geoline","ids": "]] .. mw.wikibase.getEntityIdForCurrentPage() .. [[","properties": {"stroke": "#FF9999"}}, {"type": "ExternalData","service": "geoshape","ids": "]] .. mw.wikibase.getEntityIdForCurrentPage() .. [[","properties": {"fill": "#FF0000","fill-opacity": 0.1,"stroke": "#FF9999"}} ]]endlocal globe = string.lower( args.globe or params.globe or '' )if globe == '' then globe = 'earth' endlocal result = '<span class="coordinates plainlinks nourlexpansion" data-param="' .. mw.text.encode( param ) .. '">'-- external linkslocal nogoogle = string.lower( args.nogoogle or '' )local noosm = string.lower( args.noosm or '' )local noyandex = string.lower( args.noyandex or '' )if globe == 'earth' thenresult = result .. '<span title="Показать карту">' .. globalFrame:extensionTag{name = 'maplink',content = '[' .. maplinkContent .. ']',args = maplinkArgs} .. '</span>'if nogoogle == '' or noosm == '' or noyandex == '' thenresult = result .. '<sup class="geo-services noprint">'result = result .. globalFrame:preprocess('<span class="geo-geohack" title="Карты и инструменты на GeoHack">' ..'[//tools.wmflabs.org/geohack/geohack.php?language=ru&pagename={{FULLPAGENAMEE}}¶ms=' ..uriComponents .. ' ' .. '<span>H</span>]</span>' )if nogoogle == '' thenresult = result .. '<span class="geo-google" title="Это место на «Картах Google»">[//maps.google.com/maps?'.. 'll=' .. coordinateSpec["dec-lat"] .. ',' .. coordinateSpec["dec-long"].. '&q=' .. coordinateSpec["dec-lat"] .. ',' .. coordinateSpec["dec-long"].. '&spn=' .. (scale / 1000000) .. ',' .. (scale / 1000000).. '&t=h&hl=ru '.. '<span>G</span>]</span>'endif noyandex == '' thenresult = result .. '<span class="geo-yandex" title="Это место на «Яндекс.Картах»">[//yandex.ru/maps/'.. '?ll=' .. coordinateSpec["dec-long"] .. ',' .. coordinateSpec["dec-lat"].. '&pt=' .. coordinateSpec["dec-long"] .. ',' .. coordinateSpec["dec-lat"].. '&spn=' .. (scale / 1000000) .. ',' .. (scale / 1000000).. '&l=' .. 'sat,skl '.. '<span>Я</span>]</span>'endif noosm == '' thenresult = result .. '<span class="geo-osm" title="Это место на карте OpenStreetMap">[https://www.openstreetmap.org/?'.. 'mlat=' .. coordinateSpec["dec-lat"] .. '&mlon=' .. coordinateSpec["dec-long"].. '&zoom=' .. zoom .. ' '.. '<span>O</span>]</span>'endresult = result .. '<span class="geo-loadmap" style="display: none;" title="Это место на картах ГШ и ГУГК">[http://loadmap.net/ru?'.. 'q=' .. coordinateSpec["dec-lat"] .. '%20' .. coordinateSpec["dec-long"].. '&z=' .. zoom.. '&s=0' .. ' '.. '<span>L</span>]</span>'result = result .. '</sup>'endelse-- FIXME [[phab:T151138]]result = result .. globalFrame:preprocess('[//tools.wmflabs.org/geohack/geohack.php?language=ru&pagename={{FULLPAGENAMEE}}¶ms=' ..uriComponents .. ' ' .. inner .. ']' )if globe == 'moon' or globe == 'mars' and nogoogle == '' thenresult = result .. '<sup class="geo-services noprint"><span class="geo-google" title="Это место на «Картах Google»">[//www.google.com/' .. globe.. '/#lat=' .. coordinateSpec["dec-lat"] .. '&lon=' .. coordinateSpec["dec-long"].. '&zoom=7'.. '&map=visible'.. '&apollo= <span>G</span>]</span></sup>'endendresult = result .. '</span>'local geodata = ''if coordinateSpec["dec-lat"] and coordinateSpec["dec-long"] thenif globe ~= 'earth' and globe ~= 'moon' thenif tonumber(coordinateSpec["dec-long"]) < 0 thencoordinateSpec["dec-long"] = tostring(360 + tonumber(coordinateSpec["dec-long"]))endendlocal frame = mw.getCurrentFrame()local geodataparams = {[1] = coordinateSpec["dec-lat"], [2] = coordinateSpec["dec-long"], [3] = coordinateSpec["extra_param"], ['globe'] = globe }if string.find( Display, 'title' ) ~= nil and mw.title.getCurrentTitle():inNamespace(0) thengeodataparams[4] = 'primary'endif coordinateSpec["name"] thengeodataparams.name = coordinateSpec["name"]endgeodata = frame:callParserFunction('#coordinates', geodataparams )result = result .. geodataendreturn errors and result .. errors or resultend--[[Formats any error messages generated for display]]function errorPrinter(errors)local result = ""for i,v in ipairs(errors) dolocal errorHTML = '<strong class="error">Координаты: ' .. v[2] .. '</strong>'result = result .. errorHTML .. "<br />"endif result ~= '' thenif mw.title.getCurrentTitle():inNamespace(0) thenreturn result .. '[[Категория:Страницы с некорректными тегами координат]]'elsereturn resultendendend--[[Determine the required CSS class to display coordinatesUsually geo-nondefault is hidden by CSS, unless a user has overridden this for himselfdefault is the mode as specificied by the user when calling the {{coord}} templatemode is the display mode (dec or dms) that we will need to determine the css class for]]function displayDefault(default, mode)if default == "" thendefault = "dec"endif default == mode thenreturn "geo-default"elsereturn "geo-nondefault"endend--[[Check the input arguments for coord to determine the kind of data being providedand then make the necessary processing.]]function formatTest(args)local result, errors;local param, extra_param = {}, {}local globe = string.lower( args.globe or '' )if not globe_list:find('|' .. globe .. '|') thenreturn nil, errorPrinter( {{"formatTest", "неизвестный глобус"}} )endif args[4] == "" and args[5] == "" and args[6] == "" then-- dec logicresult, errors = parseDec( args[1], args[2], args['format'] )param = { args[1], "N", args[2], "E", args[3] };elseif dmsTest(args[4], args[8]) then-- dms logicresult, errors = parseDMS( args[1], args[2], args[3], args[4],args[5], args[6], args[7], args[8], args['format'] )param = { args[1], args[2], args[3], args[4], args[5],args[6], args[7], args[8], args[9] };if args[10] ~= '' thentable.insert( errors, { 'formatTest', 'неожиданные дополнительные параметры' } );endelseif dmsTest(args[3], args[6]) then-- dm logicresult, errors = parseDMS( args[1], args[2], nil, args[3],args[4], args[5], nil, args[6], args['format'] )param = { args[1], args[2], args[3], args[4], args[5], args[6], args[7] };if args[8] ~= '' thentable.insert( errors, { 'formatTest', 'неожиданные дополнительные параметры' } );endelseif dmsTest(args[2], args[4]) then-- d logicresult, errors = parseDMS( args[1], nil, nil, args[2],args[3], nil, nil, args[4], args['format'] )param = { args[1], args[2], args[3], args[4], args[5] };if args[6] ~= '' thentable.insert( errors, { 'formatTest', 'неожиданные дополнительные параметры' } );endelse-- Errorreturn nil, errorPrinter( {{"formatTest", "неизвестный формат аргумента"}} )endif not result then return nil, errorPrinter( errors )endresult.name = args["name"]local last = table.getn (param)if param[last] == '' thentable.remove(param, last)endlocal extra_params = { 'dim', 'globe', 'scale', 'region', 'source', 'type' }for _, v in ipairs( extra_params ) doif (args[v] or '') ~= '' thentable.insert( extra_param, v .. ':' .. args[v] );endendresult.param = table.concat( param , '_' );result.extra_param = table.concat( extra_param , '_' );return result, errorPrinter( errors )end--[[Helper function, convert decimal latitude or longitude todegrees, minutes, and seconds format based on the specified precision.]]function convert_dec2dms(coordinate, firstPostfix, secondPostfix, precision)local coord = tonumber(coordinate) or 0local postfixif coord >= 0 thenpostfix = firstPostfixelsepostfix = secondPostfixendprecision = precision:lower();if precision == "dms" thenreturn convert_dec2dms_dms( math.abs( coord ) ) .. postfix;elseif precision == "dm" thenreturn convert_dec2dms_dm( math.abs( coord ) ) .. postfix;elseif precision == "d" thenreturn convert_dec2dms_d( math.abs( coord ) ) .. postfix;endend--[[ 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 % 60coordinate = math.floor( (coordinate - s) / 60 );local m = coordinate % 60coordinate = 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 0local minutes = tonumber(minutes_str) or 0local seconds = tonumber(seconds_str) or 0local factordirection = mw.ustring.gsub(direction, '^[ ]*(.-)[ ]*$', '%1');if direction == "S" or direction == "W" thenfactor = -1elsefactor = 1endlocal precision = 0if seconds_str ~= nil and seconds_str ~= '' thenprecision = 5 + math.max( math_mod._precision(seconds_str), 0 );elseif minutes_str ~= nil and minutes_str ~= '' thenprecision = 3 + math.max( math_mod._precision(minutes_str), 0 );elseprecision = math.max( math_mod._precision(degrees_str), 0 );endlocal 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 = {};if long_d == nil or long_d == '' thentable.insert(errors, {source, "пропущена долгота"})endif lat_d == nil or lat_d == '' thentable.insert(errors, {source, "пропущена широта"})endlat_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 thenif lat_d < 0 thentable.insert(errors, {source, "градусы широты < 0"})endif long_d < 0 thentable.insert(errors, {source, "градусы долготы < 0"})end--[[#coordinates is inconsistent about whether this is an error. If globe: isspecified, it won't error on this condition, but otherwise it will.For not simply disable this check.if long_d > 180 thentable.insert(errors, {source, "longitude degrees > 180 with hemisphere flag"})end]]endif lat_d > 90 thentable.insert(errors, {source, "градусы широты > 90"})endif lat_d < -90 thentable.insert(errors, {source, "градусы широты < -90"})endif lat_m >= 60 thentable.insert(errors, {source, "минуты широты >= 60"})endif lat_m < 0 thentable.insert(errors, {source, "минуты широты < 0"})endif lat_s >= 60 thentable.insert(errors, {source, "секунды широты >= 60"})endif lat_s < 0 thentable.insert(errors, {source, "секунды широты < 0"})endif long_d >= 360 thentable.insert(errors, {source, "градусы долготы >= 360"})endif long_d <= -360 thentable.insert(errors, {source, "градусы долготы <= -360"})endif long_m >= 60 thentable.insert(errors, {source, "минуты долготы >= 60"})endif long_m < 0 thentable.insert(errors, {source, "минуты долготы < 0"})endif long_s >= 60 thentable.insert(errors, {source, "секунды долготы >= 60"})endif long_s < 0 thentable.insert(errors, {source, "секунды долготы < 0"})endreturn errors;endlocal function splitCoord(args, s)if s and s~= nil thenlocal iterator = mw.ustring.gmatch(s, "[^/]+");local i = 1;for w in iterator doargs[i] = w;i = i + 1;endendfor i=1,10 doif args[i] == nil thenargs[i] = ""elseargs[i] = args[i]:match( '^%s*(.-)%s*$' ); --remove whitespaceendendreturn argsend--[[Helper function to determine whether to use D, DM, or DMSformat 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 thenreturn 'd'elseif precision <= 2 thenreturn 'dm';elsereturn 'dms';endend--[[coordMain 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 andconfiguration options.Note: This function provides the visual display elements of {{coord}}. Inorder to load coordinates into the database, the {{#coordinates:}} parserfunction must also be called, this is done automatically in the Luaversion of {{coord}}.]]function coordinates.coord(frame)globalFrame = framelocal args = frame.argsif args[1] == nil thenlocal pFrame = frame:getParent();args = pFrame.args;for k,v in pairs( frame.args ) doargs[k] = v;endendlocal coord = args.coord or nil;args = splitCoord(args, coord)args['format'] = args['format'] or '';Display = string.lower(args.display or "inline")local contents = specPrinter(args)local Notes = args.notes or ""if Display == '' thenDisplay = 'inline';endlocal text = ''if string.find( Display, 'inline' ) ~= nil thentext = displayinline(contents, Notes)endif string.find( Display, 'title' ) ~= nil thendisplaytitle_ = truetext = text .. displaytitle(contents, Notes, frame)endreturn textendfunction coordinates.getLon(frame)local args = frame.argsargs = splitCoord(args, args[1])local out = formatTest(args)return out['dec-long']endfunction coordinates.getLat(frame)local args = frame.argsargs = splitCoord(args, args[1])local out = formatTest(args)return out['dec-lat']endreturn coordinates
🔥 Top keywords: Тӧс бӱкКош-АгашВикипедия:Ӧмӧликтиҥ порталыВикипедия:ЈартамалыВикипедия:КурултайРоссияХристиан јаҥВикипедия:Талдама бичимелдерКичӱ изӱ айдыҥ 8 кӱниОрус тилКаспий талайВикипедия:Курултай/2020Чаган айдыҥ 7 кӱниСанкт-ПетербургЭдилАҥылу:Свежие правкиАлтай тилКичӱ изӱ айВикипедия:Курултай/2021МСК+4:00Чаган айдыҥ 3 кӱниАзимов, АйзекВикипедия:Кӱнниҥ кӧргӱзӱзиМоскваКочкор айдыҥ 6 кӱниАлтыгы НовгородАрсланКочкор айдыҥ 26 кӱниИталияӰлекер:Potd/NextMonthБӧкӰлекер:Potd/MonthӰлекер:Potd/2023-03Чаган айдыҥ 22 кӱниРадиоТуружаачы:ТолушБӧрӱАк-кийикАҥылу:Моё обсуждениеТулаан айдыҥ 14 кӱниШӱӱжӱ:Тӧс бӱкАпшыйактыКатегория:ISBN куулгазын ссылкаларын тузаланган бӱктерАйАҥылу:Мой вкладШекспир, УильямПутин, Владимир ВладимировичКочкор айдыҥ 27 кӱниВикипедия:ПрессаАлтай калыкКатегория:БастыраБулгаков, Михаил АфанасьевичКуран айдыҥ 24 кӱниКуран айдыҥ 6 кӱниЈопонФайл:Flag of Tuva.svgӰлӱрген айдыҥ 27 кӱниФайл:Flag of Altai Republic.svgВикипедия:ТалдаштарКӱчӱрген айдыҥ 3 кӱниАлтай РеспубликаТулаан айдыҥ 1 кӱниКандык айдыҥ 18 кӱниКӱӱк айдыҥ 12 кӱниЭкинурМехикоОҥдой аймакЫжыЧаган айдыҥ 2 кӱниКокышев, Лазарь ВасильевичЈодралуСыгын айдыҥ 5 кӱниЧаган айдыҥ 8 кӱниФинляндияКебезенниҥ јурт јеезезиКӱчӱрген айдыҥ 25 кӱниСыгын айдыҥ 26 кӱниБарре-Синусси, ФрансуазаЈаан изӱ айдыҥ 1 кӱниФайл:Flag of the Kumukh people.pngКичӱ изӱ айдыҥ 10 кӱниӰлекер:Cite webКуран айдыҥ 22 кӱниКатегория:ВикипедияЈаан изӱ айдыҥ 8 кӱниКичӱ изӱ айдыҥ 19 кӱниӰлекер:Ref-langКатегория:МатематикаКазахстанВолгоградКандык айдыҥ 8 кӱниФайл:FullMoon2010.jpgЈаан изӱ айдыҥ 18 кӱниЧаган айдыҥ 10 кӱниТуружаачыны шӱӱжери:35.203.136.212Јаан изӱ айдыҥ 19 кӱниКуран айдыҥ 18 кӱниӰстӱги-КӧкӧйӧКаспа