<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://chaldeanwiki.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://chaldeanwiki.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AGeobox_coor"/>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Geobox_coor&amp;action=history"/>
		<updated>2026-10-23T13:33:09Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.0</generator>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Geobox_coor&amp;diff=2421&amp;oldid=prev</id>
		<title>Frietjes: return nothing when nothing is passed in</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Geobox_coor&amp;diff=2421&amp;oldid=prev"/>
				<updated>2015-03-18T22:09:50Z</updated>
		
		<summary type="html">&lt;p&gt;return nothing when nothing is passed in&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;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and s:match( '^%s*(.-)%s*$' ) ~= ''&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's documentation.&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = require('Module:Arguments').getArgs(frame, {&lt;br /&gt;
			wrappers = 'Template:Geobox coor'&lt;br /&gt;
		})&lt;br /&gt;
		return geobox_coor[funcName](args, frame)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function coord_wrapper(frame, in_args)&lt;br /&gt;
	return frame:expandTemplate{ title = 'coord', args = in_args }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
geobox_coor.coord = makeInvokeFunc('_coord')&lt;br /&gt;
function geobox_coor._coord(args, frame)&lt;br /&gt;
	local tstr = args['9'] or 'type:other'&lt;br /&gt;
	local dstr = isnotempty(args['title']) and 'inline,title' or 'inline'&lt;br /&gt;
	local lat_dir = isnotempty(args[4]) and args[4] or 'N'&lt;br /&gt;
	local lon_dir = isnotempty(args[8]) and args[8] or 'E'&lt;br /&gt;
	local prefix = args['prefix'] or ''&lt;br /&gt;
	local suffix = args['suffix'] or ''&lt;br /&gt;
	local innerprefix = args['innerprefix'] or ''&lt;br /&gt;
	local innersuffix = args['innersuffix'] or ''&lt;br /&gt;
	&lt;br /&gt;
	local cstr = ''&lt;br /&gt;
	&lt;br /&gt;
	if( isnotempty(args[3]) ) then&lt;br /&gt;
		cstr = coord_wrapper(frame,&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['format'] or 'dms', display = dstr}&lt;br /&gt;
			)&lt;br /&gt;
	elseif( isnotempty(args[2]) ) then&lt;br /&gt;
		cstr = coord_wrapper(frame,&lt;br /&gt;
			{args[1], args[2], lat_dir, args[5], args[6], lon_dir, &lt;br /&gt;
				tstr, format = args['format'] or 'dms', display = dstr}&lt;br /&gt;
			)&lt;br /&gt;
	elseif( isnotempty(args[4]) ) then&lt;br /&gt;
		cstr = coord_wrapper(frame,&lt;br /&gt;
			{args[1], lat_dir, args[5], lon_dir, &lt;br /&gt;
				tstr, format = args['format'] or 'dec', display = dstr}&lt;br /&gt;
			)&lt;br /&gt;
	elseif( isnotempty(args[1]) ) then&lt;br /&gt;
		cstr = coord_wrapper(frame,&lt;br /&gt;
			{args[1], args[5],&lt;br /&gt;
				tstr, format = args['format'] or 'dec', display = dstr}&lt;br /&gt;
			)&lt;br /&gt;
	elseif( isnotempty(args['wikidata']) 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 == 'value') 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_wrapper(frame,&lt;br /&gt;
				{latitude, longitude, tstr, format = args['format'] or 'dms', display = dstr}&lt;br /&gt;
				)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return ''	&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if(isnotempty(args['wrap'])) then&lt;br /&gt;
		return prefix .. innerprefix .. cstr .. innersuffix .. suffix&lt;br /&gt;
	else &lt;br /&gt;
		return prefix .. '&amp;lt;span style=&amp;quot;white-space:nowrap&amp;quot;&amp;gt;' .. innerprefix .. cstr  .. innersuffix .. '&amp;lt;/span&amp;gt;' .. suffix&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return geobox_coor&lt;/div&gt;</summary>
		<author><name>Frietjes</name></author>	</entry>

	</feed>