Wikipedia talk:Coordinates in infoboxes/Archive 1

Why does it work?
Just to see what would happen, I tried converting the parameters in the Infobox building at Abbotsford House. The marker in the map is still correctly placed, even after a purge. So some of the templates don't need changing? Wasn't there a module change that was required? Is that already live? I'm confused. &#8213; Mandruss  &#9742;  01:47, 29 August 2016 (UTC)
 * Location map also calls coordinates from Wikidata, so that's probably what happened in this case. Jc86035 (talk • contribs) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 01:55, 29 August 2016 (UTC)

Hello, world
Ok we're here now. Next step is to populate the tracking table. I can do that if one of you can work some magic to provide me a list of all infobox templates that need conversion, or tell me how to do same. &#8213; Mandruss  &#9742;  01:22, 29 August 2016 (UTC)

Never mind, I think I got it. &#8213; Mandruss  &#9742;  04:26, 29 August 2016 (UTC)

Infobox coord
Template:Infobox coord appears to be some kind of special animal. We need to understand how it fits into all this. &#8213; Mandruss  &#9742;  04:41, 29 August 2016 (UTC)
 * Like Geobox coor (are there others?), it's a Coord wrapper which just allows every parameter to be entered individually. Since we figured out we could extract and inject Coord information without having to separate it into individual parameters (at some point in the next two weeks I'll build some sort of coord2text function into Location map/sandbox just to make it easier for everyone), it won't really have a purpose anymore. —Jc86035 (talk • contribs) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 11:03, 29 August 2016 (UTC)

As for Location map: That really didn't take as long as I expected.

Jc86035 (talk • contribs) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 11:41, 29 August 2016 (UTC) The tracking table is populated. I'm not sure I got everything, but what I have probably represents upwards of 99.99999% of infobox transclusions and will take years (or decades) to complete (Infobox settlement alone has 458,620 transclusions; who knows how many of them use the deprecated parameters). If we ever finished that much, I'd call it done, or close enough. &#8213; Mandruss  &#9742;  12:16, 29 August 2016 (UTC) to reply to me 10:55, 21 September 2016 (UTC)
 * You seem to think I understand more of this than I do. &#8213; Mandruss  &#9742;  11:58, 29 August 2016 (UTC)
 * In short, we don't need it (or Geobox coor) Geobox coor is still useful for Wikidata, unless we add that to Coord. Jc86035 (talk • contribs) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 12:45, 29 August 2016 (UTC) anymore because instead of using them we could just stick Coord straight into Location map. Right now the latitude, longitude etc. have to be entered separately, which is probably why we have this mess in the first place. —Jc86035 (talk • contribs) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 12:07, 29 August 2016 (UTC)
 * I see, I think. I assume that changes the template change instructions, hopefully simplifying them? If you can get those instructions added to the other page, I can start doing edit requests for protected templates.
 * I think AutoWikiBrowser plus asking for a bot to do stuff with it could definitely drop that down to less than a year. Most uses of infoboxes have the parameters in neatly-shaped blocks (easy to handle with regexes), but it would still require multiple bot runs for many infoboxes due to variations in how the parameters are copied. Jc86035 (talk • contribs) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 12:45, 29 August 2016 (UTC)
 * Again, I'll be leaving that stuff to you and other geeks. The more I learn about this, the more I see my role in the task shrinking. E.g., I thought I could handle most of the doc updates, but then I saw the wide variations in docs, and now I think many of those should be left to the people already familiar with those docs. But I'll make a good clerk. &#8213; Mandruss  &#9742;  12:54, 29 August 2016 (UTC)
 * - While I did see my role in the task shrinking, I never intended it to fall to zero. Anything I can do? &#8213; Mandruss  &#9742;  05:05, 21 September 2016 (UTC)
 * While there are still 139 infoboxes left to modify, until the BRFA request is approved there's pretty much nothing to do (for now), since even if you update the infoboxes (example) and their documentation, it'd take you practically forever to replace all instances manually. However, since I'm probably going to take an extended wikibreak soon, it might help if you or someone else starts fixing more of the infoboxes and adding the parameter-replacement templates (like those on the BRFA page) after the bot is actually approved for trial. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Infobox beach converted
I have converted Infobox beach. It was harder than I thought it would be. Can someone please check that I did it correctly? Thanks. – Jonesey95 (talk) 18:21, 11 November 2016 (UTC) to reply to me 04:29, 12 November 2016 (UTC)
 * Fixed. The  function only adds   if there isn't an   in the Coord template's parameters (the parser function is unnecessary); and the category should go right after Geobox coor/Infobox coord. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Instructions needed
It would be helpful if the Help page explained how to change a template to conform with the RfC outcome, and then how to change transclusions of the template to convert them to the recommended parameters. – Jonesey95 (talk) 01:52, 29 August 2016 (UTC)
 * The former has long been in the plan. Since Jc is the one who understands the template changes, that's in his court, and I think he agrees. As for the latter, how much help is needed? The infobox docs will be updated with language like, "The following parameters are deprecated and should be replaced by coordinates: [list of parameters]". If an editor knows how to use Coord, that's enough; if not, they should leave the conversion to someone else or learn how to use Coord first. Anyway, considering the lack of consistency in parameter naming, any dumbed-down one-size-fits-all instructions would be very difficult to write—and understand. &#8213; Mandruss  &#9742;  02:06, 29 August 2016 (UTC)

The bot has finally been approved, so let's start: Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 15:23, 11 November 2016 (UTC)
 * Most non-converted infoboxes have wikicode structure like . (The amount of spaces and newlines can vary widely.)
 * Add  to the start.
 * If there are Coord parameters (like ) which should be added automatically, instead add   (don't add more vertical bars   than necessary).
 * Replace the  at the end with.
 * If there is a Location map, Infobox map or similar template in the infobox, then add &#123;&#123;&#123;coordinates&#124;&#125;&#125;&#125; to it.

to reply to me 15:41, 11 November 2016 (UTC) to reply to me 09:25, 12 November 2016 (UTC)
 * Thanks for the vote of confidence, if any, but I really don't feel competent to help with that. I know nada about that language. I don't even know what language it is. I don't think I care to, as it looks like circa 1980 technology to me. Hey I was mostly just the idea guy in this thing anyway. I remember asking you at VPR or something how much time you were prepared to commit to this thing, and I remember you didn't reply. :D If there is something I can do at my pay grade, I'm more than happy to do it. &#8213; Mandruss  &#9742;  15:36, 11 November 2016 (UTC)
 * Well, there's not really much left that isn't either editing templates or asking JJMC89 to activate the bot… I'll ping you if there's actually anything else. Happy editing, Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * I can probably help with this. I looked at Infobox artwork to see if I could apply the instructions, and I noticed that the documentation specifically says that Location map works better with the latd/longd parameters: "One advantage of omitting the coordinates= parameter is that you can display a Location map without duplicating coordinates." It looks like we need to modify the documentation for Location map first to say how to use coord within it, then modify the documentation for Infobox artwork, then modify the template. I feel pretty confident that I can do the template editing, but I don't know how coord works yet well enough to update the documentation. – Jonesey95 (talk) 15:56, 11 November 2016 (UTC)
 * Updated Location map (+ Wikidata details as well, since it seems no one bothered to add them), although I haven't added any examples. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Infobox park conversion
It looks like the bot is done with Infobox park. I noticed a few things. I may find a couple more. – Jonesey95 (talk) 16:49, 14 November 2016 (UTC)
 * 1) Some templates have both latd/longd and coords. The bot seems to have ignored those.
 * 2) I don't know what's happening with Arroyo Burro Beach. Looks like an edge case. Also East Beach (Santa Barbara). Some pages with unsupported parameters have coordinates listed outside of the Infobox template. Not a problem.
 * 3) Rockwood Museum and Park was skipped.
 * The bot is run against Category:Pages using deprecated coordinates format.
 * These didn't appear in the tracking category based on the template logic that was present. If they did, the bot doesn't know how to handle them, so it is programmed to skip these cases. Should it remove the deprecated parameters, leaving coords as it, or should it replace the current coords with values from the deprecated parameters? (It cannot merge them.)
 * latitude and longitude were not supported by the template (thus not tracked) and were not in the bot's configuration.
 * The bot's approval didn't mention if it is permitted remove all of the deprecated parameters when migration is not needed (all are empty). I will ask for clarification on if this is permitted. —&thinsp;JJMC89&thinsp; (T·C) 17:51, 14 November 2016 (UTC)
 * In that case, I recommend ignoring cases #1 and #3 above. All it means is that pages will show up in the infobox's "unknown parameters" tracking category and will need to be cleaned up by hand. Not a big deal. – Jonesey95 (talk) 19:50, 14 November 2016 (UTC)
 * In that case, I recommend ignoring cases #1 and #3 above. All it means is that pages will show up in the infobox's "unknown parameters" tracking category and will need to be cleaned up by hand. Not a big deal. – Jonesey95 (talk) 19:50, 14 November 2016 (UTC)

Error message
Copying this from Wikipedia talk:WikiProject Geographical coordinates, where I also posted it:

As a result of the recent changes, some articles have been popping up at Category:Pages with malformed coordinate tags as having duplicate coordinates—mainly articles using Infobox protected area and Infobox islands—which I've been removing from the category by deleting the named coordinate parameters and leaving the. This morning, when I did so in Chazy Fossil Reef, instead of the location map there appeared the error message "Lua error in Module:Location_map at line 362: No value was provided for longitude". This hasn't happened before—for instance, when I did the same thing to Calanques National Park yesterday. I've been unable to track down the source of the problem. Any help here? Deor (talk) 17:57, 17 November 2016 (UTC)
 * Fixed. Deor (talk) 20:48, 17 November 2016 (UTC)

Categorize by name of infobox?
It's hard to tell which infoboxes are present in by looking at the category. I propose that we add a sort key to the categorization in the infobox code so that the articles are sorted by which infobox they use. For example, all articles using Infobox beach would be sorted under "B", and all articles using Infobox islands would be sorted under "I". This would help us locate articles that the bot was unable to modify, and it would tell us when we can move on to removing the latd/longd parameters from a given infobox. – Jonesey95 (talk) 15:46, 19 November 2016 (UTC) to reply to me 16:14, 19 November 2016 (UTC) to reply to me 04:07, 20 November 2016 (UTC) to reply to me 08:38, 20 November 2016 (UTC)
 * I was thinking of doing this as well. If we somehow have more than 26 infoboxes at the same time, we could go into Greek, CJK, Cyrillic etc. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * I have added the sort key to Infobox station. All "station" articles should sort under "S" once they have been refreshed by the job queue. – Jonesey95 (talk) 17:16, 19 November 2016 (UTC)
 * That seemed to work, so I have modified the rest of them, along with the documentation on this Help page. – Jonesey95 (talk) 01:17, 20 November 2016 (UTC)
 * I'm not sure that  is necessary, because the articles should still sort normally even if they have the same sort key. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Perhaps not. That is how it's done in the unknown parameter check, so I just copied it. A smarter person than I created that check. – Jonesey95 (talk) 06:06, 20 November 2016 (UTC)
 * It seems to be working fine after I manually forced a purge on a page (containing Infobox street, which I tested the change on) with a null edit. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Lua module error in Location map
I am unable to figure out why Location map gives a "no longitude" error in Hill-Crest. – Jonesey95 (talk) 22:25, 20 November 2016 (UTC)
 * worked out a workaround for Infobox building until we get rid of the old parameters. – Jonesey95 (talk) 05:38, 21 November 2016 (UTC)

Anyone want to take on Infobox NRHP?
Infobox NRHP has 60,000 transclusions. We should get the bot started on it. – Jonesey95 (talk) 03:03, 20 November 2016 (UTC) to reply to me 14:59, 21 November 2016 (UTC)
 * I've converted the infobox; it's ready for parameter replacement now. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Namespace
Should this page be in the Wikipedia namespace instead (since the Help namespace seems to be for MediaWiki guides and readers' supplementary information like IPA pages)? Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 14:10, 21 November 2016 (UTC) to reply to me 16:01, 21 November 2016 (UTC) to reply to me 16:02, 21 November 2016 (UTC) to reply to me 04:26, 22 November 2016 (UTC) to reply to me 04:26, 22 November 2016 (UTC)
 * Sounds right to me. I had originally envisioned it as a simple Help page with how-to text, but it has definitely turned into a sort of project page. – Jonesey95 (talk) 15:56, 21 November 2016 (UTC)
 * I've moved the page, though it's probably a bad idea to delete the redirect because there are about 10,000 edit summaries pointing to it now. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Can you update the bot's default edit summary? Thanks, Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * I would leave the redirect. Redirects are cheap.
 * I see that you updated the table. I've been thinking that we should combine steps 2 and 4 (updating the documentation). I'm thinking that it would be simpler to remove the latd/longd information from the documentation either in conjunction with adding the coords parameter or in conjunction with removing support for the latd/longd parameters entirely. Thoughts? – Jonesey95 (talk) 17:08, 21 November 2016 (UTC)
 * That sounds sensible, given that there isn't a two-month waiting period for the parameter replacement any more. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * I've updated the edit summary. —&thinsp;JJMC89&thinsp; (T·C) 02:50, 22 November 2016 (UTC)
 * Thanks. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Restrict to mainspace?
Should we restrict the deprecated parameter category to mainspace using main other? We typically do that for the unknown parameter check in infoboxes, because messing with editors' sandboxes and testcase pages is a waste of time. – Jonesey95 (talk) 03:17, 20 November 2016 (UTC) to reply to me 04:11, 20 November 2016 (UTC)
 * No, because then they wouldn't work properly after the parameters are removed. Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Do we know if the bot going to fix the articles that are not in article space? Take a look at the remaining Infobox protected area pages, for example. – Jonesey95 (talk) 17:26, 21 November 2016 (UTC)
 * I've only been running it in mainspace. Adding user and draft would not be a problem. It could be run in project and discussion namespaces at the risk of changing what was being discussed there. I will not run it in the template namespace. —&thinsp;JJMC89&thinsp; (T·C) 21:03, 21 November 2016 (UTC)
 * It looks like User and Draft space are generally safe, since they appear to be all, or almost all, draft articles. If we are not going to run the bot in a given space, we either need to do the conversions by hand or ignore those transclusions and be willing to let them break. I lean toward hand fixes in e.g. Talk spaces and Wikipedia spaces.
 * Agreed that it should not run in template space. Once we get the other pages converted, we can drop support for the deprecated parameters and remove the tracking category from the template, then those pages will fall out of the "deprecated coordinates" category. – Jonesey95 (talk) 21:22, 21 November 2016 (UTC)
 * I'm now running the bot on namespaces 0,1,2,3,4,5,118,119. Let me know if I need to add any more. —&thinsp;JJMC89&thinsp; (T·C) 02:57, 24 November 2016 (UTC)

Weird infobox
(pinging ) Does Infobox UK feature need a visible infobox field for coordinates or is it fine the weird way it is now? Jc86035 (talk) Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 12:33, 24 November 2016 (UTC)

Infobox World Heritage Site
It seems like every one of these infoboxen is a little different. Because it was simpler to implement, I added tracking to Infobox World Heritage Site in a way that will capture articles that use both lat/long and coordinates=, which is different from how we have been doing it. If this messes up the bot, feel free to change it. – Jonesey95 (talk) 16:25, 24 November 2016 (UTC)

Coordinates parser function
Just a thought: Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125; to reply to me 13:22, 24 November 2016 (UTC)
 * Who actually uses the data from the  parser function (which is included in Coord), except for Special:Nearby?
 * Isn't the API which pulls data from it redundant to Wikidata queries?
 * I don't know anything about . —&thinsp;JJMC89&thinsp; (T·C) 22:26, 24 November 2016 (UTC)

Lots of edge cases for Infobox protected area
The bot was done with Infobox protected area about 12 hours ago, so I removed support for the lat/long parameters. That removal put about 300 pages into, with about half of those falling into the "L" portion of the category. Some of them appear to have been missed by the deprecated parameter check somehow (or maybe I didn't wait long enough for the job queue to put them in the category). Others have both lat/long and coords parameters. Still others are just oddballs. If the bot can fix any of them, that would be great. – Jonesey95 (talk) 14:24, 24 November 2016 (UTC)
 * I ran the bot over the category. It fixed about 200 cases. Most were N/E or US. —&thinsp;JJMC89&thinsp; (T·C) 23:37, 24 November 2016 (UTC)

Wikidata coordinates
For Infobox islands, removing deprecated parameters when the infobox is getting the coordinates from Wikidata can cause the coordinates map to change since the removed information is lost. Compare an original to after the parameters are removed. We need a way to handle this. —&thinsp;JJMC89&thinsp; (T·C) 02:54, 24 November 2016 (UTC)
 * I don't see a difference in those two versions. What do you see? I just fixed some unsupported infobox parameters, which made a map appear.
 * In any event, I don't think we have approval to remove calls to wikidata. The WP world seems to be moving in that direction. How do we look at the wikidata property P625 for Camotes Islands? If all of the information stored in the deprecated parameters are in there, we may be able to remove most of the parameters called by Geobox coor. – Jonesey95 (talk) 03:09, 24 November 2016 (UTC)
 * I'm seeing this (original left). The zoom (dim) is different. You can use  on the page to see the value (10°40'N, 124°24'E). —&thinsp;JJMC89&thinsp; (T·C) 07:55, 24 November 2016 (UTC)

I've been playing around with Template:Infobox islands/sandbox, trying to understand how wikidata calls work. Pretty opaque so far. The current version does not work, but if you go back a couple of versions, you can see the coordinates in the infobox, but they are not linked. I don't understand how Camotes Islands gets the coordinates for the pushpin map when coordinates does not appear to be populated. Mysteries. – Jonesey95 (talk) 04:20, 24 November 2016 (UTC) to reply to me 05:12, 24 November 2016 (UTC) to reply to me 10:10, 24 November 2016 (UTC) to reply to me 11:17, 24 November 2016 (UTC) to reply to me 11:32, 24 November 2016 (UTC) to reply to me 11:47, 24 November 2016 (UTC)
 * coordinates wikidata? (Location map automatically fetches coordinates from Wikidata.) Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Module:Geobox coor (geobox coor) takes wikidata (from Infobox islands's coordinates wikidata) to get if coordinates aren't otherwise provided. Module:Coordinates (coord) only uses P625 to populate some tracking categories. It could be modified to accept wikidata to display coordinates if not otherwise provided, similar to . —&thinsp;JJMC89&thinsp; (T·C) 07:55, 24 November 2016 (UTC)
 * I see how Geobox is doing it, but it was my impression that we wanted to move away from the Geobox template to simplify the template. I was trying to retrieve and display the coords from wikidata without using Geobox coor. No luck so far. I can display them, but only inline, and they are not linked. – Jonesey95 (talk) 08:18, 24 November 2016 (UTC)
 * I modified Coord to allow Wikidata without errors (example) a while ago; unfortunately Geohack stuff has to be entered as 3. The Wikidata implementation in Geobox coor is superfluous, but we're getting rid of the template anyway so it doesn't really matter. —Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Totally missed that. The bot configs and substitutions (e.g. {{subst:Geobox coor/sandbox2}}) need to be updated so that Geohack, display, etc. are retained when using Wikidata. Special:Diff/751194783 should additionally remove true and result in coordinates. —&thinsp;JJMC89&thinsp; (T·C) 10:40, 24 November 2016 (UTC)
 * I've updated one of the wrappers. Would it work to simply set the replacement for coordinates wikidata to a nonexistent value in the JSON pages? (Also, I might try and update Module:Coordinates to allow Geohack things in the first parameter.) Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * I think it should depend on both wikidata (wrapper parameter) and P625 instead of just P625. Otherwise, we could start using Wikidata when the infobox wasn't explicitly calling it. Yes, mapping to something like dummy in the JSON config would result in the parameter being removed. —&thinsp;JJMC89&thinsp; (T·C) 22:07, 24 November 2016 (UTC)
 * I've edited the module sandbox to allow the first parameter to be used for Geohack, but I'm not sure what's happening in testcases which is causing the tests to fail. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Pinging and . Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;

@Jc86035: Is Module talk:Coordinates/testcases still a problem (looks like it is!). I use other methods for testing modules and do not know why those failed cases are appearing. Testing a couple of them manually shows that the results are identical, so the unit tester is giving a false result. For example, pasting the following in Special:ExpandTemplates gives two identical lines:

Editing Module talk:Coordinates/testcases and changing it to:

then previewing shows the above cases differs at character 947. That is bogus. A puzzling feature is that the testcase results include:

I cannot see where that comes from. A wild guess is that something in the error message is generating wikitext that is interpreted as a call to the coordinates magic word, and the magic word is outputting that stuff. Then some weirdness makes the unit test module get differing results for the two cases. Johnuniq (talk) 03:28, 25 November 2016 (UTC)

I tried adding  as an option to the test, and it shows the nature of the problem. For the case mentioned above, the expected/actual results are identical except for the following which appears at the end: '"`&#x55;NIQ--nowiki-00000019-QINU`"': invalid latitude Infobox coord : invalid latitude There is a nowiki tag in the output and it is being converted to a strip marker, and because there are two of them, they get different id values (one has 19 and the other has 18). I haven't time to look more now, but the nowiki might be part of what I mentioned, namely that the magic word is being invoked somehow. Johnuniq (talk) 07:30, 25 November 2016 (UTC) to reply to me 08:15, 25 November 2016 (UTC)
 * I've merged the change for now, because if the problem is in the parser function's error message it's probably not fixable (and was in the old version as well). Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;

@Jc86035: I had another look at Module:Coordinates and while it is too complex for me to want to figure out, the general problem appears to be that it detects an error, but proceeds to try and output the result anyway. My guess is that

ends up executing these lines taken from various parts of the module: function coordinates._coord(args) local contents, backward = formatTest(args) local function validate( lat_d, lat_m, lat_s, long_d, long_m, long_s, source, strong ) table.insert(errors, {source, "latitude degrees > 90"}) -- (error text is then put into the output, but it also executes the following) text = text .. coord_wrapper(args) return mw.getCurrentFrame:callParserFunction('#coordinates', in_args) or '' The last line uses the parser function  with invalid parameters, and that causes it to output its own error message. That message is: &lt;nowiki>&lt;/nowiki>: invalid latitude The nowiki tags are then processed by Module:UnitTests, but because the expected and actual outputs each have nowiki, they get different unique IDs, and the test fails because the wikitext appears to be different. Module:Coordinates should be fixed so that it does not call if an error has been detected. Johnuniq (talk) 09:39, 25 November 2016 (UTC) to reply to me 09:51, 25 November 2016 (UTC) to reply to me 10:14, 25 November 2016 (UTC)
 * I think that's potentially more trouble than it's worth, because the module's not supposed to output error messages anyway, and the module appears to have a lot of nested functions which would require splitting up or outputting extra values to allow the error-checking results to be found by the top-level  function. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * I do not understand that. To slightly correct my above post, the case I was considering was:
 * Notice that the output shows two error messages: "Coordinates: latitude degrees > 90" is from the module, and "invalid latitude" is from the parser function. What is the point of that? Johnuniq (talk) 10:02, 25 November 2016 (UTC)
 * Possibly whoever wrote the module thought that "invalid" wasn't specific enough. (The parser function also used to be in Coord rather than the module.) There's not really any additional harm done by having both of them, and it would be more trouble than it's worth to remove the one displayed by the parser function. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Possibly whoever wrote the module thought that "invalid" wasn't specific enough. (The parser function also used to be in Coord rather than the module.) There's not really any additional harm done by having both of them, and it would be more trouble than it's worth to remove the one displayed by the parser function. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Default locmap appearing in embedded NRHP infoboxes
Hello, something about migrating the coordinates in the NRHP infobox is causing a default locmap to appear in NRHP boxes, even when locmapin is empty. This can be particularly undesirable when the NRHP infobox is a secondary infobox, or embedded in a container infobox which already contains a locmap. See for example here. I don't know how to not have a default map appear in this instance, and the default "world" map is unhelpful, but repeating the New York map would look silly.Thanks by the way for all of your work on this project, standardizing how coordinates behave in infoboxes is a much-needed improvement. Antepenultimate (talk) 15:03, 25 November 2016 (UTC)
 * Nice catch, and thank you for your patience with us. It seems like every one of these infoboxes is a little different, and editors have historically used them differently. Our cleanup work is unearthing some of the quirks and oddities that were previously hidden. So far, editors looking at articles that we have affected (or broken!) have been patient with us and allowed us to fix the infoboxes rather than going through contentious reverts. Hooray for good faith!


 * It looks like Infobox NRHP has been tweaked to eliminate this extraneous location map. Affected articles may require a WP:NULLEDIT (click edit and then save without making any changes) to hide the unwanted map. – Jonesey95 (talk) 17:31, 25 November 2016 (UTC)


 * Wow, that was fast! Thanks for the quick fix. Really, no patience required on my end, I can't even imagine the quirks you folks must run into while slaying this particular wiki-Hydra. What required patience was trying to learn and remember each infobox's coord/locmap/lat/long idiosyncrasies as a new editor, often through trial-and-error. Working within the already-converted infoboxes is so, so much easier in comparison. Thanks again to everyone working toward this fix! Antepenultimate (talk) 18:11, 25 November 2016 (UTC)

Infobox mine and wikidata is strange too
I added infobox mine to Telford Cut today with a location map. As far as I can tell, the I put in the infobox are irrelevant, and the location map is using the coordinate data from Wikidata that have apparently been imported from enwiki. I tried to follow the instructions to upgrade infobox mine to support the new system, but it is too complex for me to be confident I would get it right. It does not display the value in the coordinates field, but will generate coordinates from the many individual parameters or from wikidata. --Scott Davis Talk 12:43, 24 November 2016 (UTC) to reply to me 13:12, 24 November 2016 (UTC)
 * I've converted the template; the article's coordinates should display properly now. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Thank you. --Scott Davis Talk 21:48, 26 November 2016 (UTC)

Infobox language
Of the 8,000 articles that transclude Infobox language, only 31 articles use latd=. I suggest converting the template to use #invoke:Coordinates and then converting those 31 articles manually (or with a script) instead of waiting for them to be added to the maintenance category. – Jonesey95 (talk) 04:24, 1 December 2016 (UTC)

A problem with converting coordinates in Infobox ecoregion

 * [moved from User talk:Jonesey95] by Jonesey95

There's a problem in converting Infobox ecoregion that you (and others) may not have anticipated. The same problem occurs in Infobox mountain.

There is a parameter of Infobox ecoregion: area, which gets passed to Infobox dim. Infobox dim takes the area and estimates the size of the ecoregion, passes it to the dim parameter of Infobox coord. This makes the Geohack map automagically have the correct size to show the entire ecoregion. It works pretty well, see Klamath Mountains (ecoregion) and click on the Coordinates link, then click on the Google terrain map. You'll see that the map is automatically zoomed out to roughly include the whole ecoregion.

This same feature works for mountain ranges with supplied lengths, widths, or areas, in Infobox mountain.

Unfortunately, this currently will not work if a user supplies a coordinates field with coord. In the current setup, only the coordinates field is parsed, not any other argument. Would it be possible to pass the output of Infobox dim into the parser to keep the estimated dim?

Pinging, because he/she understands all of the Lua magic involved.

Can we hold off any conversion of ecoregions (and mountains) until we resolve? Thanks! —hike395 (talk) 07:03, 1 December 2016 (UTC)
 * That is some lovely Infobox magic. I think I see how it works, and we should be able to make it work with Coord as well. Pinging for an FYI. I'm pretty sure that we can do the conversions correctly by adjusting the infobox and the bot's code, but I don't yet see how we will allow people to use this auto-workaround-magic in the future if they want to use the Coord template in Infobox ecoregion without entering the dim: value. Interesting.  – Jonesey95 (talk) 13:59, 1 December 2016 (UTC)
 * I've changed to   in  to add the default type:landmark and to convert area to dim: or use scale:3000000. Please check the converted  to ensure the result is what your want. —&thinsp;JJMC89&thinsp; (T·C) 22:31, 1 December 2016 (UTC)
 * Superb! It works! Thanks for your help: I think I can generalize this to Infobox mountain —hike395 (talk) 05:24, 2 December 2016 (UTC)

More Lua errors: Infobox ancient site
I posted this elsewhere, but it's probably better here. It relates to the behavior of Template:Infobox ancient site:


 * Edits like this one and this one, to remove redundant coordinate information and clear Category:Pages with malformed coordinate tags, work fine; but the same sorts of edit here and here are throwing up location-map error messages.

Also, in some cases, location maps are failing to display a marker at the specified coordinates, even though they haven't been significantly changed, as here. Can someone fix this? Deor (talk) 01:03, 7 December 2016 (UTC)
 * has not been updated to accept coordinates for the location map. If map_type is set and latitude and longitude are not provided, you get a Lua error if coordinates are not available on Wikidata. For the first pair of diffs, coordinates are pulled from Wikidata for the location map since no local coordinates are available. For the second pair of diffs, map_type is set but no coordinates are available to it. For the last diff, The coordinates that were on Wikidata (51°18'48"N, 1°37'7"W) were used since no local coordinates are available. I'll update that infobox now. —&thinsp;JJMC89&thinsp; (T·C) 01:35, 7 December 2016 (UTC)
 * ✅ I've updated Infobox ancient site. —&thinsp;JJMC89&thinsp; (T·C) 02:07, 7 December 2016 (UTC)

Template:Infobox map/Map display methods
This is a reminder to myself and others working here that Template:Infobox map/Map display methods will need to be updated once all of the templates that transclude it have been converted. – Jonesey95 (talk) 05:09, 8 December 2016 (UTC)

Infobox glacier
Someone might want to check my edits to Infobox glacier. It had some tricky stuff in it.

Also, when converting articles, note that the default display is, so if display is empty, it should be set to that, unless there is a way to edit the coordinsert to do the same thing by default. Same with Infobox cave. – Jonesey95 (talk) 04:44, 8 December 2016 (UTC) to reply to me 06:53, 8 December 2016 (UTC)
 * Following up on my own question: it appears that Infobox coord sets inline,title by default, but Coord does not. How should we address this situation in our conversions? I don't see it in the instructions on this page. – Jonesey95 (talk) 05:20, 8 December 2016 (UTC)
 * I think you're just supposed to recommend it in the documentation's examples (and use the Geobox coor/sandbox2 wrapper to make the default inline,title). Modifying the coordinates' display with the Lua module would be possible but not really all that useful, and it would be inconsistent behaviour with the other templates we've updated. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * That sounds fine. We just need to make sure that the bot knows to set this variable for articles so that the article does not render differently after the conversion. – Jonesey95 (talk) 15:23, 8 December 2016 (UTC)

Removal of coordinsert of scale/dim parameters from infoboxes
Hi. I notice that just removed scale from the coordinsert function in Infobox cave and scale + dim from Infobox glacier. Is that because they are unused in all articles? Just wanted to check. Thanks! —hike395 (talk) 08:37, 10 December 2016 (UTC)
 * They shouldn't have been added to coordinsert in the first place. dim and scale are used with lat_d, long_d, etc. (which are being migrated), not coordinates. —&thinsp;JJMC89&thinsp; (T·C) 08:46, 10 December 2016 (UTC)
 * Sorry -- I thought the infobox was using a trick similar to described, above, for Infobox ecoregion.
 * Does your bot code automatically fold existing uses of scale and dim into parameters of a new coord? If so, then everything should be great. —hike395 (talk) 09:54, 10 December 2016 (UTC)
 * Yes, all of the coordinates parameters, including scale and dim, get mapped into . —&thinsp;JJMC89&thinsp; (T·C) 00:15, 11 December 2016 (UTC)
 * Wonderful, thanks! —hike395 (talk) 00:34, 11 December 2016 (UTC)

Infobox settlement wrappers
Some articles using infoboxes that are wrappers for Infobox settlement (notably Template:Infobox U.S. metropolitan area) are popping up at Category:Pages with malformed coordinate tags (even the Infobox U.S. metropolitan area template itself is in the maintenance category). With regard to the metropolian-area infobox, I was surprised that many or all of the articles do not even contain coordinates, either here or on Wikidata. The template itself does contain yes, removing which seems to take it out of the maintenance category. Can that parameter just be eliminated, or is there a better fix? Deor (talk) 17:08, 12 December 2016 (UTC)
 * I'm guessing that the cause is this change by . I don't understand wikidata well enough to know why that change would cause the above problem. – Jonesey95 (talk) 17:27, 12 December 2016 (UTC)
 * Deor and Jonesey95, that was a mistake on my part. hopefully fixed now. Frietjes (talk) 17:39, 12 December 2016 (UTC)

Infobox river
I think we need a custom substitution wrapper for infobox river. It uses geobox coor with name, and none of the Geobox coor sandboxes support name. also has different default values for name for each of the six sets of coordinates. —&thinsp;JJMC89&thinsp; (T·C) 09:02, 10 December 2016 (UTC) to reply to me 15:07, 11 December 2016 (UTC) to reply to me 04:51, 13 December 2016 (UTC)
 * That's why I have avoided it so far. Pinging, who has been playing with Geoboxen and might be able to offer some advice. – Jonesey95 (talk) 17:28, 10 December 2016 (UTC)
 * can you explain the problem? I can write a javascript script to convert the fine-grained lat/long coordinates into  .  or we could ask  who wrote bot code for doing the opposite conversion. is that the problem? Frietjes (talk) 13:57, 11 December 2016 (UTC)
 * Ignore it; Geobox coor doesn't support name in the first place so it doesn't currently work anyway. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Jc86035, should it support name? I wrote the module and I can certainly add that feature. Frietjes (talk) 15:11, 11 December 2016 (UTC)
 * Geobox coor is being deprecated, so I don't think name needs to be added. coord does support name, so I think we should migrate it even though it doesn't currently work. —&thinsp;JJMC89&thinsp; (T·C) 20:56, 11 December 2016 (UTC)
 * Frietjes added the parameter after writing her comment, so it should work now. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;

Infobox settlement is used in many other infoboxes
I just stumbled across Category:Templates calling Infobox settlement. Many of these templates have lat/long parameters and are not listed in the table. Once we fix Infobox settlement, we need to fix templates that transclude it before removing the deprecated parameters entirely. – Jonesey95 (talk) 18:08, 22 November 2016 (UTC)
 * P.S. Infobox settlement has 460,000 transclusions. Let's take it on, but let's be careful. We are sure to run into all sorts of edge cases. – Jonesey95 (talk) 17:01, 23 November 2016 (UTC)
 * I think we should add coordinates to and all of the templates calling it then have the bot run on all of the templates calling Infobox settlement before . —&thinsp;JJMC89&thinsp; (T·C) 02:55, 24 November 2016 (UTC)
 * This sounds like a good plan. I have added (to the list) a bunch of infoboxes that transclude Infobox settlement that were somehow missed in the initial scan.


 * If someone with more guts than me is willing to edit Infobox settlement, I can take on the templates that transclude it.


 * I found one non-infobox that needs to be tracked here: Template:Saskatchewan communities is a subst-only template that will need one line of code fixed after we edit Infobox settlement. – Jonesey95 (talk) 01:09, 13 December 2016 (UTC)

As of this time stamp, coordinates and the tracking category have been added to Infobox settlement. There will no doubt be many odd problems and edge cases caused by this change. Be prepared. – Jonesey95 (talk) 16:33, 17 December 2016 (UTC)
 * A note from the Infobox settlement documentation: "If the parameter is omitted, blank, or equal to 'inline', the coordinates will be displayed in the infobox only. Any value other than 'inline' will have the coordinates displayed in the article's title as well." The bot will need to pay attention to this configuration. – Jonesey95 (talk) 14:46, 22 December 2016 (UTC)

Bot report
I have had the bot do a pass on most of the currently converted templates, except Infobox settlement. For runs starting this week, skips due to having deprecated coordinates parameters and something already in coordinates are listed on this report for human review. (Please remove any that you resolve.) —&thinsp;JJMC89&thinsp; (T·C) 04:42, 15 January 2017 (UTC)

Geobox coords?
Hi, first of all I didn't see the RFC until after closure (and rarely comment in such discussions anyhow) but I hugely support this endeavor. This may be a stupid question, but are there any plans to do similar work for the Geobox templates? I really prefer Geoboxes for some topics, but the inability to use coord has always been a pet peeve (at least, their Field Legend doesn't specify how to use coords). Does the fact that some Geoboxes (Rivers in particular) often contain multiple sets of coords (though with only one used for the location map) complicate things? Thanks and keep up the good work! Antepenultimate (talk) 00:10, 1 September 2016 (UTC) to reply to me 11:02, 21 September 2016 (UTC) to reply to me 09:37, 18 January 2017 (UTC)
 * I believe that since Geoboxes are infoboxes, they'll probably end up being converted as well, but hasn't added them to the tracking list yet (probably because they aren't prefixed with "Infobox"). If there are multiple sets of coordinates, it doesn't really complicate things very much; the parameters will just be replaced with {{coord}}, {{coord}}, etc. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * It makes sense to me to do Geoboxes, since they seem very similar to infoboxes, but we might want to do a separate RFC. I just stumbled upon Plymouth Meeting, Pennsylvania, which uses a geobox where Infobox settlement would probably work just fine. – Jonesey95 (talk) 04:51, 18 January 2017 (UTC)
 * I don't think a separate RfC is necessary, since (because they use the CSS  class) they're infoboxes anyway. Jc86035 (talk) <span style="display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:80%;text-align:left">Use &#123;&#123;re&#124;Jc86035&#125;&#125;
 * Geoboxes are ready for conversion by the bot. – Jonesey95 (talk) 16:26, 20 January 2017 (UTC)

Coordinates and gbmapping template
There are few articles that are putting data in the coordinates parameter in the infobox that is not latitude/longitude data. They are using the gbmapping template to show Ordnance Survey National Grid information.

Rather than just replacing the coordinates param in those cases with just Coord when then latitude & longitude params are replaced, would it also be possible to keep in the gbmapping data as well with just a br tag between the two?

There's not too many to look at. Only [//en.wikipedia.org/w/index.php?title=Special:Search&limit=300&offset=0&profile=default&search=insource%3A%2F%5C%7C+%2Acoordinates+%2A%5C%3D+%2A%5C%7B%5C%7B%5BGg%5Dbmapping%2F 275 articles]. -- WOSlinker (talk) 13:27, 22 January 2017 (UTC)
 * , if you don't mind, could you please move this discussion to Wikipedia talk:Coordinates in infoboxes? That will put the discussion in the right archive once we come to a consensus. There are multiple infoboxes that use gbmapping, and we should come up with a standard way of managing them. Thanks. – Jonesey95 (talk) 17:05, 22 January 2017 (UTC)
 * One other option might be to add a grid_ref parameter to Infobox military installation -- WOSlinker (talk) 17:45, 22 January 2017 (UTC)


 * label2        = Grid reference
 * data2         =
 * This is what Infobox historic site and Infobox UK place do. I think it makes more sense than jamming the GB mapping info into coordinates. – Jonesey95 (talk) 14:47, 23 January 2017 (UTC)

Ukrainian raions
I can't figure out what you guys did to Template:Infobox Ukrainian raion, but many articles containing it (all of them?) are now displaying an "Invalid arguments have been passed to the function" error. See Category:Pages with malformed coordinate tags. Deor (talk) 15:36, 23 January 2017 (UTC)
 * , I don't see the problem right away, but I'll work on it right now and revert myself if I can't fix it. I'm sure I did something dumb. Every one of these infoboxes treats coordinates a little differently. – Jonesey95 (talk) 16:46, 23 January 2017 (UTC)
 * Fixed. I had been editing too late at night and made a mistake. Thanks for bringing it to our attention. – Jonesey95 (talk) 16:49, 23 January 2017 (UTC)
 * I have purged all of the problem articles and fixed a couple of others (using different infoboxes) that had snuck into the error category amidst all of the noise. Sorry for the trouble. – Jonesey95 (talk) 17:13, 23 January 2017 (UTC)

I think something is wrong with Infobox settlement with "coordinates_display=title" or "coord|display=title"
This one is for. Edit the lead section of Amsterdam, and change coordinates_display to "inline,title", then to "inline", and then to "title", previewing after each change to watch the behavior of the coordinates' display. Note that "title" shows inline coordinates in the infobox, even though it should not (I believe). I am unable to trace how Infobox settlement is processing this parameter (through Geobox coor?) to determine why this is happening.

I stumbled across this problem when I converted Guanta Municipality to use coord. The result, with "display=title" in the coord template, shows the coords in the title properly but shows "Coordinates:" in the infobox with no coordinates afterwards.

I can't tell if this is one bug, two related bugs, or two different bugs. Or if I am doing something wrong, which happens frequently. – Jonesey95 (talk) 06:37, 27 January 2017 (UTC)
 * Jonesey95, the geobox coor template only has two options, (1) display the coordinates inline, or (2) display the coordinates inline and title. if the title parameter in  is blank or omitted, then option 1.  if the title parameter in  is not blank, then option 2.  in other words, there is option to make geobox coor only put the coordinates in the title.  this is by design (a long story).  the way this is translated into the code in infobox settlement is that: (a) if inline then the coordinates are only displayed inline, (b) if coordinates_display is blank then the coordinates are only displayed inline, and (c) if foobar where foobar is any other non-blank value, the coordinates are displayed inline and title.  so, if you are converting the coordinates in infobox settlement the translation table is as follows


 * note that you could translate (blank) and (omitted) to (blank) and (omitted) since that's the default for coord. this is, of course, one of the reasons why we are going to the new format, so that an editor doesn't have to learn the syntax for every template (and, as you know, the functionality is frequently different from template to template). Frietjes (talk) 13:23, 27 January 2017 (UTC)
 * OK, that makes some kind of sense. Good thing we're moving away from that.


 * I still wonder why "Coordinates:" shows with no coordinates in the infobox of this version of Guanta Municipality after I converted the article to use coord with "display=title". I didn't see a way to control it, since it uses an Infobox settlement wrapper template. Does Infobox settlement have the ability to show coords in the title only? – Jonesey95 (talk) 16:09, 27 January 2017 (UTC)

Two more settlement templates left
Infobox French commune and Infobox Province of China (PRC) are the last two infobox settlement transclusions left. They have complex enough syntax that I would prefer that someone else modify them. – Jonesey95 (talk) 06:33, 28 January 2017 (UTC)
 * migrated and converted. —&thinsp;JJMC89&thinsp; (T·C) 05:23, 29 January 2017 (UTC)
 * I think that's all the infobox settlement transclusions within templates, so unless I'm missing something, the bot can start working on articles transcluding infobox settlement directly. – Jonesey95 (talk) 06:14, 29 January 2017 (UTC)

Infobox Australian place
after a long discussion at Template talk:Infobox Australian place, the coordinates in that infobox can be safely converted to use coordinates. basically, there was a problem that latd/longd would add a location map, but coordinates would not. so, after some discussion, we added a new parameter, map_type which toggles the inclusion or suppression of the location map. I have already gone through all the articles and added the necessary map_type, so the coordinates format can be changed without changing whether or not a location map appears. the only other gotchas for this template is that you must make sure the coordinates are in the correct hemisphere, and use the map_scale / coord_type parameters if specified. The latitude values in latd are transformed internally if necessary to make sure that they are in the Southern hemisphere (i.e., latd = abs(latd) with latNS = S ). it would probably be nice to include the region when converting, but it's not entirely critical since the coordinates insert does this. the location map code for this template is in an auxiliary module, Module:Australian place map, since the logic for the particular map used is somewhat complicated (hence all the other discussion on the talk page). Frietjes (talk) 00:31, 14 March 2017 (UTC)