Jump to content

Template talk:Coord

Page contents not supported in other languages.
Coordinates: 11°13′15″N 123°44′45″E / 11.22083°N 123.74583°E / 11.22083; 123.74583
geometric centre[1]
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 91.10.32.201 (talk) at 17:01, 19 May 2013 (→‎Slight Display Error: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Lua replacement

We are getting closer to the point of being able to replace the current template {{coord}} with the Lua based version in {{coord/sandbox}}. My benchmarking suggests that the replacement will takes us from around 14 Coord calls per second to around 45 Coord calls per second. Much of the lag that is left actually seems to be associated with the #coordinates parser function which stores location information in the database, as the formatting part of the Lua Coord calls runs very, very fast.

There are some minor variations in the Lua version from the current version.

  1. The Lua code maintains trailing zeros on decimal expansions when necessary to reach the requested precision, the current template will drop these.
  2. The Lua code is more verbose in generating error messages.
  3. The Lua code traps all formatting errors to Category:Pages with malformed coordinate tags rather than just some errors.

Template:Coord/testcases shows examples of both working results and error messages shown on malformed results. Module_talk:Coordinates/tests also shows example of the current template output and the current Lua draft. Dragons flight (talk) 19:23, 5 March 2013 (UTC)[reply]

A very useful side effect of the switch to Lua is that more than 400 instances of {{coord}} can now appear successfully on one page. Years ago, I had split List of canals in Oregon—with a total of 661 coordinates—into two articles to get around the template expansion limitation. I have remerged the articles. It mostly works, though sometimes there is a server timeout. However, it has yet to fail to display all the coordinates—before it would display the first 300-some coordinates and then blank the rest out. A job well done! Thanks, —EncMstr (talk) 00:56, 11 March 2013 (UTC)[reply]
I measure 57 seconds -- I wouldn't really count that as "mostly working". If you also use the Lua version of {{convert}} then it only takes 20 seconds, which is somewhat closer to working. -- Tim Starling (talk) 06:11, 14 March 2013 (UTC)[reply]
I was not aware there was a Lua version of convert. It does not appear you saved a modified version (why not?), so I'll see if I can figure out how to set up the Lua version of convert. (Looks like an explicit invocation might be called for, like {{#module:convert}}. Am I close?) I, too, am seeing Served by mw1111 in 51.875 secs. as is. What is your threshold for "working"? Ten seconds? —EncMstr (talk) 08:32, 14 March 2013 (UTC)[reply]
Lua convert is not yet installed because it is still being developed and won't cover all cases that {{convert}} does. It might be functional enough for certain pages, but I'd generally suggest waiting until they get it finished. Dragons flight (talk) 15:39, 14 March 2013 (UTC)[reply]

Formats

It would be of huge benefit to us translators if the new template could also cope with coordinates presented in the format dd/mm/ss/NS and dd/mm/ss/EW for latitude and longitude parameters. This would greatly simplify process for importing infoboxes, since lat and long are often in that format and the result is we waste lots of time manually converting dms to decimal on a calculator and then changing the data in the infoboxes. --Bermicourt (talk) 17:41, 6 March 2013 (UTC)[reply]

{{Coord}} can already handle DMS values. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 17:11, 7 March 2013 (UTC)[reply]
But not the slashes. Dewiki uses slashes, but enwiki found it too difficult to parse. —Stepheng3 (talk) 17:13, 7 March 2013 (UTC)[reply]
Can you show some exact examples of what you mean, i.e. is that {{coord| 15/24/32/N | 18/59/02/W }} or {{coord| 15/24/32 | N | 18/59/02 | W }} or what? Obviously, the standard format {{coord| 15 | 24 | 32 | N | 18 | 59 | 02 | W }} = 15°24′32″N 18°59′02″W / 15.40889°N 18.98389°W / 15.40889; -18.98389, already works, so I'm not sure why one would need to get out a calculator. A link to relevant examples on dewiki might also help. Dragons flight (talk) 17:39, 7 March 2013 (UTC)[reply]
de:Brandenburger Tor#Einzelnachweise contains the line
{{Coordinate |NS=52/30/59/N |EW=13/22/40/E |type=landmark |region=DE-BE}}
Our own {{coordinate}} template takes similar input and converts it; {{Coordinate|NS=52/30/59/N|EW=13/22/40/E|type=landmark}} displays as 52°30′59″N 13°22′40″E / 52.51639°N 13.37778°E / 52.51639; 13.37778. I'm sure we discussed this very matter two or three years back. --Redrose64 (talk) 19:13, 7 March 2013 (UTC)[reply]
Just found Template talk:Coord/Archive 9#Reading imported coord formats; there may have been others. --Redrose64 (talk) 19:15, 7 March 2013 (UTC)[reply]
@Dragon's flight. The most common problem I come across is copying an infobox from German wiki when I'm translating the article. Typically the infobox parameters look like: |BREITENGRAD=47/09/46/N and |LÄNGENGRAD=13/23/38/E for the lat and long coords respectively. These are usually only recognised by the various templates that handle such situations if the coords are manually converted to decimal. I've tried sorting this out but my template skills aren't up to it! For a recent article I translated, see de:Weißeck for the German original and Weißeck for the English wiki version where I've had to convert the coords. It's not too big a deal for one infobox, but I've already translated over 3,000 articles and it gets tedious when a fix would handle it automatically.
@Redrose64. Yes, you're right, I did raise it before. It was suggested I use {{coordinate}}, but I couldn't see how to get it to work and gave up I'm afraid. Sorry. --Bermicourt (talk) 15:25, 11 March 2013 (UTC)[reply]

footnotes for title coordinates

The behavior of the notes= parameter with title coordinates has changed recently, and I wonder if this is connected with the recent Lua rewrite.

In the past, the footnote indications for title coordinates appeared in the top right corner of the page, immediately to the right of the title coordinates, which seems to me the most logical place. Now the footnote indications are appearing at the left side of the first or second line below the page title. This separates the indication from the information being annotated.

Articles impacted by the change include Mitchell Creek, Rhododendron Creek, and Goat Rock Beach. —Stepheng3 (talk) 20:45, 13 March 2013 (UTC)[reply]

You're right, my bad. This should be fixed now though it will take a while for all the pages to be regenerated. You can check it by purging any of those pages. Dragons flight (talk) 21:39, 13 March 2013 (UTC)[reply]
Thanks for the quick fix. It seems to be working. —Stepheng3 (talk) 22:29, 13 March 2013 (UTC)[reply]
Instead of footnoting the coordinates, wouldn't it be better to put the reference in the body of the article? It would make it easier to click on if it was. Apteva (talk) 19:17, 11 May 2013 (UTC)[reply]

Leading zeroes

Hi! Shouldn't minutes and seconds have leading zeroes if they are less than 10? For instance, I guess it should be 10°02′04″N 10°01′05″W instead of 10°2′4″N 10°1′5″W --DixonD (talk) 21:47, 21 March 2013 (UTC)[reply]

Up until now, that's been at the editor's discretion. See archived discussion at Wikipedia talk:WikiProject Geographical coordinates/Archive_28#Leading_zeroes. Why do you believe there should be leading zeroes in the minutes and seconds? —Stepheng3 (talk) 23:53, 21 March 2013 (UTC)[reply]
Is "0000000012 per dozen" more correct than "12 per dozen"? Since most coordinates are for processing by humans or (presumably) smart machines, I expect the more direct, less verbose form would be preferred. As far as I know, only iron dinosaurs running ancient software, often written in COBOL or FORTRAN, prefer leading zeros.
Additionally, using degrees, minutes, and second is quaint: a convention of the old days when paper maps had grids with subdivisions based on those. Most people now use digital maps or GPS devices, etc. For those, it is generally more convenient to input and output those as signed decimal degrees, such as 10.034443,-10.018158 or, if needed to clarify that is a location where the context is ambiguous, 10.034443 N 10.018158 WEncMstr (talk) 06:36, 22 March 2013 (UTC)[reply]
I find that quite arch and cavalier - you are saying human beings should be more like machines rather than the other way? I am quite happy with one degree of latitude being 100km, which makes one minute about 1600 metres and one second of arc less than 30 metres. But decimals leave me completely cold, especially with people's obsession with 6 or 8 decimal places. Leading zero too is important, as it is a place-filler, so you know there is nothing missing.
John of Cromer in Philippines (talk) mytime= Mon 22:17, wikitime= 14:17, 15 April 2013 (UTC)[reply]

Statistics, Geolocated article

As in the French Wikipedia, I would like to change {{Coord/display/inline,title}} and {{Coord/display/title}} (See http://fr.wikipedia.org/w/index.php?title=Mod%C3%A8le%3ACoord%2Fdisplay%2Finline%2Ctitle&diff=91902006&oldid=91897673).

I would like to add

{{#ifeq: {{NAMESPACE}}| {{ns:0}}|[[Category:Geolocated article]]}}

.

Then in Category:Geolocated article, we can see the number of geolocated articles, as in fr:Catégorie:Article géolocalisé.

How would this be any more useful than the template counting tool?—Stepheng3 (talk) 15:24, 11 April 2013 (UTC)[reply]
See the number in http://toolserver.org/~jarry/templatecount/index.php?lang=fr&namespace=10&name=Coord#bottom (255,112 articles) and see the number in fr:Catégorie:Article géolocalisé (253 446 articles). There is a difference ! Why ? Because it's a question of namespace. toolserver count all the page, even the page of namespace user, talk, etc. fr:Catégorie:Article géolocalisé count only the pages in the main namespace
Furthermore, it's important to write this code in {{Coord/display/inline,title}} and {{Coord/display/title}}, and no in {{coord}}. In fact, {{coord}} can be use anywhere in the article. {{Coord/display/inline,title}} and {{Coord/display/title}}, as the name "title" suggest, display the geolocation in the top left-hand corner.
Excuse me for my bad English, but I'm a French contributor. It's hard to write in english !
--Juanes852 (talk) 16:26, 11 April 2013 (UTC)[reply]
Since the rewrite of {{coord}} to use Module:Coordinates, the use of subtemplates (including {{Coord/display/inline,title}} and {{Coord/display/title}}) had decreased dramatically. --Redrose64 (talk) 19:48, 11 April 2013 (UTC)[reply]
Thank you for replying,
So my idea is not interesting ?
Could you tell me what is the interest of Module:Coordinates ? Maybe we must use it in Wikipedia in French ?
--Juanes852 (talk) 20:37, 11 April 2013 (UTC)[reply]
It reduces the time required to generate {{coord}} displays by 75%. Otherwise the results are identical to what the previous template produced. Dragons flight (talk) 20:41, 11 April 2013 (UTC)[reply]
We can still create a tracking category for articles with primary coordinates. We'd just need to implement it in Module:Coordinates, not in {{Coord/display/title}}. I don't object to that, though it seems frivolous. Does anyone besides Juanes852 want such a tracking category? —Stepheng3 (talk) 23:23, 11 April 2013 (UTC)[reply]
@Dragons flight, thanks for your precisions. I am going to suggeste Module:Coordinates in fr:projet:géolocalisation
In Module:Coordinates, I'm reading : "This module is intended to replace the functionality of {{Coord}} and related templates."
So, when in an article there is Module:Coordinates there isn't {{Coord/display/inline,title}} and {{Coord/display/title}}, and vice versa when there is {{Coord/display/inline,title}} or {{Coord/display/inline,title}} there isn't Module:Coordinates.
So, in three pages ({{Coord/display/inline,title}}, {{Coord/display/inline,title}}, and Module:Coordinates), we must add
{{#ifeq: {{NAMESPACE}}| {{ns:0}}|[[Category:Geolocated article]]}}

.

Be careful, the interest in Category:Geolocated article (or fr:Catégorie:article géolocalisé) is to know the number of Geolocated article ; the interest isn't have a tracking category.
--Juanes852 (talk) 10:10, 15 April 2013 (UTC)[reply]
I don't think that anything is actually still using {{Coord/display/inline,title}} and {{Coord/display/title}}. It is true that the "what links here" for Template:Coord/display/inline,title has a list of articles, but if you pick any one of these and WP:NULLEDIT it, it will drop out of the list when next refreshed, which suggests that the job queue hasn't got to these pages yet. --Redrose64 (talk) 11:26, 15 April 2013 (UTC)[reply]
Redrose64, thanks for replying, I know. --Juanes852 (talk) 13:36, 15 April 2013 (UTC)[reply]

some problem with toolserver/geohack

- can't find page

I tried several different pages

John of Cromer in Philippines (talk) mytime= Sat 12:07, wikitime= 04:07, 13 April 2013 (UTC)[reply]

You're not the only one suffering. See Wikipedia talk:WikiProject Geographical coordinates#Toolserver broken?, for instance. —Stepheng3 (talk) 05:51, 13 April 2013 (UTC)[reply]
It's a general problem with Toolserver, see WP:VPT#Toolserver is down again. --Redrose64 (talk) 06:26, 13 April 2013 (UTC)[reply]
Like all things wiki, I never really know the correct place to report things, but usually I get directed. NB Wikipedia talk:WikiProject Geographical coordinates#Toolserver broken? was 6 days ago John of Cromer in Philippines (talk) mytime= Sat 14:29, wikitime= 06:29, 13 April 2013 (UTC)[reply]
There are still problems with this. Going to the toolserver over HTTPS works though, so if someone know how to change the link in the template we should probably do so, at least as a temporary fix. Bjelleklang - talk 07:34, 16 April 2013 (UTC)[reply]

Duplicated footnote id

I don't have my head in this template, but it looks like it is rendered twice but displayed once? If a footnote is included in the notes, then the generated HTML id is duplicated, which is wrong. For example, this results in the cite id cite_ref-nmts1_1-1 being generated twice:


Markup Renders as
<ref name=nmts1>xxx</ref>

{{coord|11|13|15|N|123|44|45|E|type:isle_dim:35000_region:PH-07|notes=<br />
geometric centre<ref name=nmts1 />|display=title,inline}}

{{reflist}}

[1]

11°13′15″N 123°44′45″E / 11.22083°N 123.74583°E / 11.22083; 123.74583
geometric centre[1]

  1. ^ a b xxx

--  Gadget850 (Ed) talk 15:04, 18 April 2013 (UTC)[reply]

Putting that through Special:ExpandTemplates yields
<span class="plainlinks nourlexpansion">[//toolserver.org/~geohack/geohack.php?pagename=Special:ExpandTemplates&params=11_13_15_N_123_44_45_E_type:isle_dim:35000_region:PH-07 <span class="geo-default"><span class="geo-dms" title="Maps, aerial photos, and other data for this location"><span class="latitude">11°13′15″N</span> <span class="longitude">123°44′45″E</span></span></span><span class="geo-multi-punct">&#xfeff; / &#xfeff;</span><span class="geo-nondefault"><span class="geo-dec" title="Maps, aerial photos, and other data for this location">11.22083°N 123.74583°E</span><span style="display:none">&#xfeff; / <span class="geo">11.22083; 123.74583</span></span></span>]</span><br />
geometric centre<ref name=nmts1 /><span style="font-size: small;"><span id="coordinates">[[Geographic coordinate system|Coordinates]]: <span class="plainlinks nourlexpansion">[//toolserver.org/~geohack/geohack.php?pagename=Special:ExpandTemplates&params=11_13_15_N_123_44_45_E_type:isle_dim:35000_region:PH-07 <span class="geo-default"><span class="geo-dms" title="Maps, aerial photos, and other data for this location"><span class="latitude">11°13′15″N</span> <span class="longitude">123°44′45″E</span></span></span><span class="geo-multi-punct">&#xfeff; / &#xfeff;</span><span class="geo-nondefault"><span class="geo-dec" title="Maps, aerial photos, and other data for this location">11.22083°N 123.74583°E</span><span style="display:none">&#xfeff; / <span class="geo">11.22083; 123.74583</span></span></span>]</span><br />
geometric centre<ref name=nmts1 /></span></span>
Only one of the HTML elements has an id= attribute; there's a <span id="coordinates"> --Redrose64 (talk) 19:18, 18 April 2013 (UTC)[reply]
If you check the original markup, <ref name=nmts1 /> is included once, but shows twice in the ExpandTemplates output. But, ExpandTemplates does not expand Cite references. The rendered HTML is:
<span class="plainlinks nourlexpansion"><a rel="nofollow" class="external text" href="//toolserver.org/~geohack/geohack.php?pagename=Template_talk:Coord&amp;params=11_13_15_N_123_44_45_E_type:isle_dim:35000_region:PH-07"><span class="geo-default"><span class="geo-dms" title="Maps, aerial photos, and other data for this location"><span class="latitude">11°13′15″N</span> <span class="longitude">123°44′45″E</span></span></span><span class="geo-multi-punct"> / </span><span class="geo-nondefault"><span class="geo-dec" title="Maps, aerial photos, and other data for this location">11.22083°N 123.74583°E</span><span style="display:none"> / <span class="geo">11.22083; 123.74583</span></span></span></a></span><br />
geometric centre<sup id="cite_ref-nmts1_1-1" class="reference"><a href="#cite_note-nmts1-1"><span>[</span>1<span>]</span></a></sup><span style="font-size: small;"><span id="coordinates"><a href="/wiki/Geographic_coordinate_system" title="Geographic coordinate system">Coordinates</a>: <span class="plainlinks nourlexpansion"><a rel="nofollow" class="external text" href="//toolserver.org/~geohack/geohack.php?pagename=Template_talk:Coord&amp;params=11_13_15_N_123_44_45_E_type:isle_dim:35000_region:PH-07"><span class="geo-default"><span class="geo-dms" title="Maps, aerial photos, and other data for this location"><span class="latitude">11°13′15″N</span> <span class="longitude">123°44′45″E</span></span></span><span class="geo-multi-punct"> / </span><span class="geo-nondefault"><span class="geo-dec" title="Maps, aerial photos, and other data for this location">11.22083°N 123.74583°E</span><span style="display:none"> / <span class="geo">11.22083; 123.74583</span></span></span></a></span><br />
geometric centre<sup id="cite_ref-nmts1_1-1" class="reference"><a href="#cite_note-nmts1-1"><span>[</span>1<span>]</span></a></sup></span></span></p>
<div class="reflist references-column-width" style="-moz-column-width: close; -webkit-column-width: close; column-width: close; list-style-type: decimal;">
<ol class="references">
<li id="cite_note-nmts1-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-nmts1_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-nmts1_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text">xxx</span></li>
</ol>

You will find two instances of <sup id="cite_ref-nmts1_1-1" class="reference">. When you invoke a named reference multiple times, the id should increment like:

  • <sup id="cite_ref-nmts1_1-1" class="reference">
  • <sup id="cite_ref-nmts1_1-2" class="reference">
But, that is not happening here. --  Gadget850 (Ed) talk 19:43, 18 April 2013 (UTC)[reply]
The behavior is different, but I think this is the same underlying problem as bugzilla:46815, where frame:preprocess leads to inappropriate caching of ref tags. If you know explicitly that one needs to generate a ref tag then one can workaround and render it via frame:extensionTag, but I don't think there is any current solution for the general case of a ref embedded in random text that needs to be parsed. Dragons flight (talk) 20:02, 18 April 2013 (UTC)[reply]

Slight Display Error

This

({{Coord|37|1|54|N|27|25|46|E|display=inline,title}})

inserts a break space right before the closing parenthesis (and possibly elsewhere). --91.10.32.201 (talk) 17:00, 19 May 2013 (UTC)[reply]