Jump to content

Wikipedia talk:Coordinates in infoboxes/Archive 1

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1Archive 2

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. ―Mandruss  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 {{re|Jc86035}} to reply to me 01:55, 29 August 2016 (UTC)

Hello, world

@Jc86035 and Jonesey95: 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. ―Mandruss  01:22, 29 August 2016 (UTC)

Never mind, I think I got it. ―Mandruss  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. ―Mandruss  04:41, 29 August 2016 (UTC)

@Mandruss: 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 {{re|Jc86035}} to reply to me 11:03, 29 August 2016 (UTC)

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

London is located in the United Kingdom
London
London
Location of London in the UK
{{Location map/sandbox | UK
| coordinates = {{Coord|51|30|26|N|0|7|39|W}}
| width       = 120
| label       = London
| caption     = Location of London in the UK
}}

Jc86035 (talk • contribs) Use {{re|Jc86035}} to reply to me 11:41, 29 August 2016 (UTC)

You seem to think I understand more of this than I do. ―Mandruss  11:58, 29 August 2016 (UTC)
@Mandruss: 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 {{re|Jc86035}} 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 {{re|Jc86035}} to reply to me 12:07, 29 August 2016 (UTC)
@Jc86035: 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.
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. ―Mandruss  12:16, 29 August 2016 (UTC)
@Mandruss: 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 {{re|Jc86035}} 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. ―Mandruss  12:54, 29 August 2016 (UTC)
@Jc86035: - While I did see my role in the task shrinking, I never intended it to fall to zero. Anything I can do? ―Mandruss  05:05, 21 September 2016 (UTC)
@Mandruss: 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 {{re|Jc86035}}
to reply to me
10:55, 21 September 2016 (UTC)

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)

@Jonesey95: Fixed. The coordinsert function only adds alice:bob if there isn't an alice:anything else 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 {{re|Jc86035}}
to reply to me
04:29, 12 November 2016 (UTC)

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)

@Jonesey95: 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={{Coord}}: [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. ―Mandruss  02:06, 29 August 2016 (UTC)

@Jonesey95 and Mandruss: The bot has finally been approved, so let's start:

  • Most non-converted infoboxes have wikicode structure like {{#if:{{Both|{{{latitude|}}}|{{{longitude|}} }}}|{{Geobox coor}}/{{Infobox coord}}|{{{coordinates|}}} }}. (The amount of spaces and newlines can vary widely.)
  • Add {{#if:{{{coordinates|}}}|{{{coordinates}}}| to the start.
    • If there are {{Coord}} parameters (like type:airport) which should be added automatically, instead add {{#if:{{{coordinates|}}}|{{#invoke:Coordinates|coordinsert|{{{coordinates|}}}|parameter|parameter2|parameter3…}}| (don't add more vertical bars | than necessary).
  • Replace the |{{{coordinates|}}} }} at the end with [[Category:Pages using deprecated coordinates format]]}} }}.
  • If there is a {{Location map}}, {{Infobox map}} or similar template in the infobox, then add |coordinates={{{coordinates|}}} to it.

Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
15:23, 11 November 2016 (UTC)

@Jc86035: 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. ―Mandruss  15:36, 11 November 2016 (UTC)
@Mandruss: 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 {{re|Jc86035}}
to reply to me
15:41, 11 November 2016 (UTC)
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)
@Jonesey95: 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 {{re|Jc86035}}
to reply to me
09:25, 12 November 2016 (UTC)

Infobox park conversion

It looks like the bot is done with Infobox park. I noticed a few things.

  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.

I may find a couple more. – Jonesey95 (talk) 16:49, 14 November 2016 (UTC)

The bot is run against Category:Pages using deprecated coordinates format.
  1. 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.)
  2.  
  3. |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. — JJMC89(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)

Error message

@Jc86035: 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 {{coord}}. 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 Category:Pages using deprecated coordinates format 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)

@Jonesey95: 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 {{re|Jc86035}}
to reply to me
16:14, 19 November 2016 (UTC)
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)
@Jonesey95: I'm not sure that {{PAGENAME}} is necessary, because the articles should still sort normally even if they have the same sort key. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
04:07, 20 November 2016 (UTC)
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)
@Jonesey95: 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 {{re|Jc86035}}
to reply to me
08:38, 20 November 2016 (UTC)

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)

Jc86035 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)

@Jonesey95: I've converted the infobox; it's ready for parameter replacement now. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
14:59, 21 November 2016 (UTC)

Namespace

@Jonesey95 and JJMC89: 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 {{re|Jc86035}}
to reply to me
14:10, 21 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)
@Jonesey95: 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 {{re|Jc86035}}
to reply to me
16:01, 21 November 2016 (UTC)
@JJMC89: Can you update the bot's default edit summary? Thanks, Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
16:02, 21 November 2016 (UTC)
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)
@Jonesey95: That sounds sensible, given that there isn't a two-month waiting period for the parameter replacement any more. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
04:26, 22 November 2016 (UTC)
I've updated the edit summary. — JJMC89(T·C) 02:50, 22 November 2016 (UTC)
Thanks. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
04:26, 22 November 2016 (UTC)

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)

@Jonesey95: No, because then they wouldn't work properly after the parameters are removed. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
04:11, 20 November 2016 (UTC)
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. — JJMC89(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. — JJMC89(T·C) 02:57, 24 November 2016 (UTC)

Weird infobox

(pinging Twiceuponatime) Does {{Infobox UK feature}} need a visible infobox field for coordinates or is it fine the weird way it is now? Jc86035 (talk) Use {{re|Jc86035}}
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:

  • Who actually uses the data from the {{#coordinates:}} parser function (which is included in {{Coord}}), except for Special:Nearby?
  • Isn't the API which pulls data from it redundant to Wikidata queries?

Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
13:22, 24 November 2016 (UTC)

I don't know anything about {{#coordinates}}. — JJMC89(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 Category:Pages using infobox protected area with unknown parameters, 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 |lat_NS=N/|long_EW=E or |region=US. — JJMC89(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. — JJMC89(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 {{#property:P625}} on the page to see the value (10°40'N, 124°24'E). — JJMC89(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)

@Jonesey95: |coordinates wikidata=? ({{Location map}} automatically fetches coordinates from Wikidata.) Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
05:12, 24 November 2016 (UTC)
Module:Geobox coor ({{geobox coor}}) takes |wikidata= (from {{Infobox islands}}'s |coordinates wikidata=) to get coordinate location (P625) 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 {{geobox coor}}. — JJMC89(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)
@JJMC89 and Jonesey95: 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) Use {{re|Jc86035}}
to reply to me
10:10, 24 November 2016 (UTC)
@Jc86035: 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 |coordinates wikidata=true and result in |coordinates={{coord|3=dim:1000_region:{{PH wikidata|coordinates_region}}_type:island|format=dms|display=inline,title}}. — JJMC89(T·C) 10:40, 24 November 2016 (UTC)
@JJMC89: 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) Use {{re|Jc86035}}
to reply to me
11:17, 24 November 2016 (UTC)
@Jc86035: I think it should depend on both |wikidata= (wrapper parameter) and P625 ({{#if:{{Both|{{{wikidata|}}}|{{#property: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. — JJMC89(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) Use {{re|Jc86035}}
to reply to me
11:32, 24 November 2016 (UTC)
Pinging Johnuniq and Mr. Stradivarius. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
11:47, 24 November 2016 (UTC)

@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:

*"{{#invoke:Coordinates|coord|90.1|1|name=Test case N>+90 dec}}"
*"{{#invoke:Coordinates/sandbox|coord|90.1|1|name=Test case N>+90 dec}}"

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

{{#invoke:Coordinates/testcases|run_tests|differs_at=1}}

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

{{#coordinates:}}: invalid longitude

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 ({{#coordinates:...}}), 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 ,{nowiki=1} 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:

<span class="error">?'"`UNIQ--nowiki-00000019-QINU`"'?: invalid latitude</span>
<span class="error">Infobox coord: invalid latitude</span>

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)

@Johnuniq: 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) Use {{re|Jc86035}}
to reply to me
08:15, 25 November 2016 (UTC)

@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

{{#invoke:Coordinates|coord|90.1|1|name=Test case N>+90 dec}}

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 {{#coordinates:}} with invalid parameters, and that causes it to output its own error message. That message is:

<span class="error"><nowiki>{{#coordinates:}}</nowiki>: invalid latitude</span>

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 {{#coordinates:}} if an error has been detected. Johnuniq (talk) 09:39, 25 November 2016 (UTC)

@Johnuniq: 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 coord function. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
09:51, 25 November 2016 (UTC)
I do not understand that. To slightly correct my above post, the case I was considering was:
  • {{#invoke:Coordinates|coord|90.1|1}}90°06′N 1°00′E / 90.1°N 1°E / 90.1; 1 Coordinates: latitude degrees > 90
    {{#coordinates:}}: invalid latitude
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)
@Johnuniq: 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) Use {{re|Jc86035}}
to reply to me
10:14, 25 November 2016 (UTC)

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!
 Fixed 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 {{{coordinates}}} 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)

@ScottDavis: I've converted the template; the article's coordinates should display properly now. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
13:12, 24 November 2016 (UTC)
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 Jc86035, 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 JJMC89 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)
@Hike395 and Jonesey95: I've changed {{{coordinates}}} to {{#invoke:Coordinates|coordinsert|{{{coordinates}}}|type:landmark|{{#if:{{{area|}}}|dim:{{Infobox dim|area_km2={{{area|}}}}}|scale:3000000}}}} in {{Infobox ecoregion}} to add the default type:landmark and to convert |area= to dim: or use scale:3000000. Please check the converted Klamath Mountains (ecoregion) (edit | talk | history | links | watch | logs) to ensure the result is what your want. — JJMC89(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

@JJMC89: 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)

@Deor: {{Infobox ancient site}} has not been updated to accept |coordinates={{coord|...}} 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. — JJMC89(T·C) 01:35, 7 December 2016 (UTC)
@Deor:  Done I've updated {{Infobox ancient site}}. — JJMC89(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 inline,title, 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)

Following up on my own question: it appears that {{Infobox coord}} sets |display=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)
@Jonesey95: 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) Use {{re|Jc86035}}
to reply to me
06:53, 8 December 2016 (UTC)
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 JJMC89 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=. — JJMC89(T·C) 08:46, 10 December 2016 (UTC)
@JJMC89: 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 {{coord}}. — JJMC89(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 |coordinates_wikidata=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 Frietjes. 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=. {{Infobox river}} also has different default values for |name= for each of the six sets of coordinates. — JJMC89(T·C) 09:02, 10 December 2016 (UTC)

That's why I have avoided it so far. Pinging Frietjes, 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 {{coord|...}}. or we could ask Plastikspork who wrote bot code for doing the opposite conversion. is that the problem? Frietjes (talk) 13:57, 11 December 2016 (UTC)
@JJMC89, Jonesey95, and Frietjes: Ignore it; {{Geobox coor}} doesn't support |name= in the first place so it doesn't currently work anyway. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
15:07, 11 December 2016 (UTC)
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. — JJMC89(T·C) 20:56, 11 December 2016 (UTC)
@JJMC89: Frietjes added the parameter after writing her comment, so it should work now. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
04:51, 13 December 2016 (UTC)

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 {{Infobox settlement}} and all of the templates calling it then have the bot run on all of the templates calling Infobox settlement before {{Infobox settlement}}. — JJMC89(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.) — JJMC89(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)

@Antepenultimate: I believe that since Geoboxes are infoboxes, they'll probably end up being converted as well, but Mandruss 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 |thingA_coordinates={{coord}}, |thingB_coordinates={{coord}}, etc. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
11:02, 21 September 2016 (UTC)
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)
@Jonesey95: I don't think a separate RfC is necessary, since (because they use the CSS infobox class) they're infoboxes anyway. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
09:37, 18 January 2017 (UTC)
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.

Bletsoe Castle
Lua error in Module:Location_map at line 411: Malformed coordinates value.
Coordinatesgrid reference TL024584


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?

Bletsoe Castle
Bletsoe Castle is located in Bedfordshire
Bletsoe Castle
Bletsoe Castle
Coordinates52°12′52″N 0°30′05″W / 52.21435°N 0.50131°W / 52.21435; -0.50131
grid reference TL024584


There's not too many to look at. Only 275 articles. -- WOSlinker (talk) 13:27, 22 January 2017 (UTC)

WOSlinker, 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          = {{{gridref|}}}
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

@Jonesey95: @JJMC89: 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 {{#coordinates:}} function" error. See Category:Pages with malformed coordinate tags. Deor (talk) 15:36, 23 January 2017 (UTC)

Deor, 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 Frietjes. 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 {{geobox coor}} is blank or omitted, then option 1. if the |title= parameter in {{geobox coor}} 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 |coordinates_display=inline then the coordinates are only displayed inline, (b) if |coordinates_display= is blank then the coordinates are only displayed inline, and (c) if |coordinates_display=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
coordinates_display= {{coord|...|display=...}}
inline inline
(blank) inline
(omitted) inline
anything else inline,title
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)

{{Infobox Province of China (PRC)}} migrated and {{Infobox French commune}} converted. — JJMC89(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={{coord}}. 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)