<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.americanmusicclub.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AGeobox_coor</id>
	<title>Module:Geobox coor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.americanmusicclub.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AGeobox_coor"/>
	<link rel="alternate" type="text/html" href="https://wiki.americanmusicclub.com/index.php?title=Module:Geobox_coor&amp;action=history"/>
	<updated>2026-04-13T02:11:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.americanmusicclub.com/index.php?title=Module:Geobox_coor&amp;diff=6112&amp;oldid=prev</id>
		<title>Amc-admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.americanmusicclub.com/index.php?title=Module:Geobox_coor&amp;diff=6112&amp;oldid=prev"/>
		<updated>2016-11-19T01:44:05Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- this module implements [[template:geobox coor]]&lt;br /&gt;
&lt;br /&gt;
local geobox_coor = {}&lt;br /&gt;
local coord_mod = require(&amp;quot;Module:Coordinates&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and s:match( &amp;#039;^%s*(.-)%s*$&amp;#039; ) ~= &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper function to grab args (from Module:Coordinates), &lt;br /&gt;
-- see Module:Arguments for this function&amp;#039;s documentation.&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {&lt;br /&gt;
			wrappers = &amp;#039;Template:Geobox coor&amp;#039;&lt;br /&gt;
		})&lt;br /&gt;
		return geobox_coor[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
geobox_coor.coord = makeInvokeFunc(&amp;#039;_coord&amp;#039;)&lt;br /&gt;
function geobox_coor._coord(args)&lt;br /&gt;
	local tstr = args[&amp;#039;9&amp;#039;] or &amp;#039;type:other&amp;#039;&lt;br /&gt;
	local dstr = isnotempty(args[&amp;#039;title&amp;#039;]) and &amp;#039;inline,title&amp;#039; or &amp;#039;inline&amp;#039;&lt;br /&gt;
	local lat_dir = isnotempty(args[4]) and args[4] or &amp;#039;N&amp;#039;&lt;br /&gt;
	local lon_dir = isnotempty(args[8]) and args[8] or &amp;#039;E&amp;#039;&lt;br /&gt;
	local prefix = args[&amp;#039;prefix&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local suffix = args[&amp;#039;suffix&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local innerprefix = args[&amp;#039;innerprefix&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local innersuffix = args[&amp;#039;innersuffix&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local cstr = &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	if( isnotempty(args[3]) ) then&lt;br /&gt;
		cstr = coord_mod._coord(&lt;br /&gt;
			{args[1], args[2], args[3], lat_dir, args[5], args[6], args[7], lon_dir, &lt;br /&gt;
				tstr, format = args[&amp;#039;format&amp;#039;] or &amp;#039;dms&amp;#039;, display = dstr}&lt;br /&gt;
			)&lt;br /&gt;
	elseif( isnotempty(args[2]) ) then&lt;br /&gt;
		cstr = coord_mod._coord(&lt;br /&gt;
			{args[1], args[2], lat_dir, args[5], args[6], lon_dir, &lt;br /&gt;
				tstr, format = args[&amp;#039;format&amp;#039;] or &amp;#039;dms&amp;#039;, display = dstr}&lt;br /&gt;
		)&lt;br /&gt;
	elseif( isnotempty(args[4]) ) then&lt;br /&gt;
		cstr = coord_mod._coord(&lt;br /&gt;
			{args[1], lat_dir, args[5], lon_dir, &lt;br /&gt;
				tstr, format = args[&amp;#039;format&amp;#039;] or &amp;#039;dec&amp;#039;, display = dstr}&lt;br /&gt;
		)&lt;br /&gt;
	elseif( isnotempty(args[1]) ) then&lt;br /&gt;
		cstr = coord_mod._coord(&lt;br /&gt;
			{args[1], args[5],&lt;br /&gt;
				tstr, format = args[&amp;#039;format&amp;#039;] or &amp;#039;dec&amp;#039;, display = dstr}&lt;br /&gt;
		)&lt;br /&gt;
	elseif( isnotempty(args[&amp;#039;wikidata&amp;#039;]) and mw.wikibase.getEntityObject()) then&lt;br /&gt;
		local entity = mw.wikibase.getEntityObject()&lt;br /&gt;
		if(entity and entity.claims	and entity.claims.P625&lt;br /&gt;
			and entity.claims.P625[1].mainsnak.snaktype == &amp;#039;value&amp;#039;) then&lt;br /&gt;
			local math_mod = require(&amp;quot;Module:Math&amp;quot;)&lt;br /&gt;
			local precision = entity.claims.P625[1].mainsnak.datavalue.value.precision&lt;br /&gt;
			local latitude = entity.claims.P625[1].mainsnak.datavalue.value.latitude&lt;br /&gt;
			local longitude = entity.claims.P625[1].mainsnak.datavalue.value.longitude&lt;br /&gt;
			if precision then&lt;br /&gt;
				precision=-math_mod._round(math.log(precision)/math.log(10),0)&lt;br /&gt;
				latitude = math_mod._round(latitude,precision)&lt;br /&gt;
				longitude= math_mod._round(longitude,precision)&lt;br /&gt;
			end&lt;br /&gt;
			cstr = coord_mod._coord(&lt;br /&gt;
				{latitude, longitude, tstr, format = args[&amp;#039;format&amp;#039;] or &amp;#039;dms&amp;#039;, display = dstr}&lt;br /&gt;
				)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if(isnotempty(args[&amp;#039;wrap&amp;#039;])) then&lt;br /&gt;
		return prefix .. innerprefix .. cstr .. innersuffix .. suffix&lt;br /&gt;
	else &lt;br /&gt;
		return prefix .. &amp;#039;&amp;lt;span style=&amp;quot;white-space:nowrap&amp;quot;&amp;gt;&amp;#039; .. innerprefix .. cstr  .. innersuffix .. &amp;#039;&amp;lt;/span&amp;gt;&amp;#039; .. suffix&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return geobox_coor&lt;/div&gt;</summary>
		<author><name>Amc-admin</name></author>
	</entry>
</feed>