Jump to content

Module talk:Coordinates/Archive 2

Page contents not supported in other languages.
Coordinates: 45°30′14″N 73°35′15″W / 45.5039°N 73.5876°W / 45.5039; -73.5876
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 06:16, 21 August 2021 (Archiving 1 discussion(s) from Module talk:Coordinates) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 1Archive 2

TPE on 11 Sep 2016

Could the sandbox versions of this module and {{Coord}} be merged into the main versions of each? This change would move the parser function {{#coordinates:}} into the module, allowing Wikidata to be used without generating errors, and would allow coordinates with latitude before longitude. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
16:23, 11 September 2016 (UTC)

@Jc86035: Some questions before a potential sync, since this is is very heavily transcluded. 1. What has been the extent of your testing and validation that your change in the module (and removal in the template) works correctly? 2. Despite WP:PERF, Could it have been possible to request this change in August and do a more cumulative sync to avoid having to edit twice to avoid server strain when possible? — Andy W. (talk ·ctb) 17:18, 11 September 2016 (UTC)
@Andy M. Wang: Removing edit request; there are a few changes I'd like to make to the p._coordinsert function first. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
02:14, 12 September 2016 (UTC)
@Andy M. Wang: Reactivated edit request; additional changes didn't work. Tested original conditions in Module talk:Coordinates/testcases (all test failures are due to the addition of the parser function and are expected) and Template:Coord/testcases. (TL;DR: Could the sandbox versions of this module and {{Coord}} be merged into the main versions of each?) Thanks, Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
13:27, 13 September 2016 (UTC)
Synced module and template. Ping/reopen if there are pending issues, cheers — Andy W. (talk ·ctb) 15:50, 13 September 2016 (UTC)
Undid, followed up on your talk — Andy W. (talk ·ctb) 16:10, 13 September 2016 (UTC)

Usage of Module:Coordinates in Module:HS listed building results in error

Hi! There seems to be an issue with the Module:Coordinates after I added picture and Commonscat for an item in the List of Category A listed buildings in Highland. I'm not quite sure if this is a mistake on my side, but even looking at old versions of the list I still get the same error message "Lua error in Module:Coordinates at line 657: Tried to read nil global frame.". Does anyone here know how to fix this? Would be much appreciated! Braveheart (talk) 14:44, 20 September 2016 (UTC)

Backed out (for now, don't know if I have time to look into this) — Andy W. (talk ·ctb) 16:00, 20 September 2016 (UTC)
@Andy M. Wang: This could probably be solved (rather quickly) by modifying HS listed building to use {{Coord}} instead of this module + the #coordinates: parser function. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
16:02, 20 September 2016 (UTC)
@Jc86035: I set up a sandbox at for the HS listing building templates/modules that call the coordinates sandbox. Can test at Template:HS listed building row/testcases to make sure the nil global frame issue can be fixed by your suggestion. — Andy W. (talk ·ctb) 16:09, 20 September 2016 (UTC)
@Jc86035: A list of modules that looks to be tangentially related or possibly be affected by the change. (very rough list, didn't go further into detail): Module:FindFeatures, Module:FindFeatures/displayDatabase, Module:Geobox coor, Module:HS listed building (error reported), Module:Location map, Module:WikidataCoord, Module:Parameters, Module:OSM, Module:WikidataIB, Module:Solar eclipse, Module:Wikidata2. Modules like Module:WikidataIB, Module:Geobox coor, and Module:Solar eclipse call expandTemplate on coord. I can't tell if any other module is using Coordinates like HS listed building is. A bit busy right now, but may find the time still to call the module directly rather than the template, which I believe is better practice — Andy W. (talk ·ctb) 17:51, 20 September 2016 (UTC)
@Andy M. Wang: I think HS listed building is likely the only module which calls Module:Coordinates directly, so none of the others should be affected. In any case, their uses would show up in Category:Pages with script errors. My Lua skills do not extend very far beyond the Ustring library, regular expressions and concatenating HTML, so it's probably up to a more experienced coder to do this. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
11:09, 21 September 2016 (UTC)
Never mind, I didn't notice that Jackmcbarn fixed it. Hopefully I haven't introduced any other weird errors in the module. Jc86035 (talk) Use {{re|Jc86035}}
to reply to me
11:14, 21 September 2016 (UTC)
Synced again, didn't find any other compatibility issues — Andy W. (talk ·ctb) 04:59, 22 September 2016 (UTC)
I just updated Module:Geobox coor to use this module directly. please revert and let me know if there are any serious problems. Frietjes (talk) 14:36, 20 October 2016 (UTC)

Coordinates not on Wikidata

Why is YouTube categorized in this category when there are coordinates on Wikidata? --Obsuser (talk) 16:03, 17 May 2017 (UTC)

This happens because YouTube on Wikidata does not have a "coordinate location" (P625) property, I believe. – Jonesey95 (talk) 16:12, 17 May 2017 (UTC)

adding a place name through coordinsert

I have added an additional feature to coordinsert in Module:Coordinates/sandbox to allow for |name= to add a place name. with this addition, {{coord|0.3|0.4|region:US|name=foobar}} is equivalent to {{#invoke:coordinates/sandbox|coordinsert|{{coord|0.3|0.4|region:US}}|name=foobar}}. you can verify this through Special:ExpandTemplates. this feature is only activated when |name= is specified, so it should have zero impact on existing uses. if there are no objections or concerns, I plan to eventually update the live module. this will help migrate Template:Mountain index row to use fully use {{coord}} without having to duplicate the name information in the coordinates call. Frietjes (talk) 13:48, 7 June 2017 (UTC)

no objections after 4 weeks, so now added. Frietjes (talk) 14:16, 5 July 2017 (UTC)

Negative E and negative N coordinates

TheDJ posted a note on my talk page: "I think there is a bug: with {{coord|45.5039|-73.5876|region:CA|display=inline,title}}: 45°30′14″N 73°35′15″W / 45.5039°N 73.5876°W / 45.5039; -73.5876. This creates a link with -73 East, which is incorrect of course. I also suspect it will call out to the parser function this way and I think that's why coordinates in this format are not in the location database..." as far as I can tell, the only place where it is incorrect is in the url. I made this change to the sandbox, which appears to fix the problem: 45°30′14″N 73°35′15″W / 45.5039°N 73.5876°W / 45.5039; -73.5876. would there be a problem if I were to make the same change to the live template? is there something that I am missing? thank you. Frietjes (talk) 13:59, 19 December 2017 (UTC)

@Frietjes: looks good to me. —TheDJ (talkcontribs) 21:39, 19 December 2017 (UTC)

To summarise:

  • {{coord|45.5039|-73.5876}} is currently passed to geohack as params=45.5039_N_-73.5876_E
  • This is odd, as decimal notation usually doesn't specify N/S/W/E unless the values are positive
  • It also turns out that the parserfunction #coordinates from the GeoData extension doesn't support this format
  • Geohack however doesn't support passing: params=45.5039_-73.5876
  • Geohack in this case expects params=45.5039;-73.5876
  • wikiminiatlas doesn't seem to support params=45.5039;-73.5876

Sigh... so the change Frietjes proposes seems to be the best we can get right now :( —TheDJ (talkcontribs) 15:35, 27 December 2017 (UTC)

Convert to indicator

@Dragons flight, Frietjes, Jc86035, TheDJ, and MaxSem: I've implemented <indicator name="coordinates">...</indicator> in this change for phab:T67648. I don't know Lua, so please review. — JJMC89(T·C) 21:13, 24 March 2018 (UTC)

We will have to prepare new CSS for all skins for this indicator. Not too much of a problem, though sizing is a bit like playing with fire here as it wasn't particularly consistent in the old template (depended on where in the document you added it, and often it was inside font-small markers in the infobox). I have prepped something for Vector.css and monobook.css. It's a little bit bigger this way in almost any instance. However it is more consistent with the font size of the tagline ("From Wikipedia, the free encyclopedia"). opinions. Note that the css has to account for the old styling rules, as due to parser caching both the old and the new will need to live side by side for a while.. (prefix the old with .mw-parser-output class ?) —TheDJ (talkcontribs) 15:34, 26 March 2018 (UTC)

Sharing from Open Street Map

I have just been retrospectively trying to find some coords for en: and commons. I can find the building- there is a tab called share- and the side panel tells me that the centre point (my building) is/has geo:51.50161,-0.04668?z=17. Going back to the days of the manframe we were taught to make it simple for the user who is by definition simple- computer power is cheap. So how about letting me paste the text geo:51.50161,-0.04668?z=17 into the first field and let the server translate it into {{coord|51.50161|-0.04668}}. I assume the pseudo code for {{{1}}}} would be on the lines of if {{{1}}}!= text| {{{1}}}}| toreal({{{1:char(5)..char(13)}}}) with a cleanup for the position of the comma. The {{{2}}} field would need to come from {{{1}}} too. This would also allow for the named fields to be added too.ClemRutter (talk) 01:22, 10 January 2018 (UTC)

The correct venue for this request is WT:Lua.--Snaevar (talk) 20:54, 2 July 2020 (UTC)

Please update the geohack link like is shown in this diff (ignore the language=is, please). This is due to the change mentioned at https://wikitech.wikimedia.org/wiki/News/Toolforge.org . The link in question is broken currently and the aforementioned diff would fix it.--Snaevar (talk) 23:07, 7 July 2020 (UTC)

 DoneJonesey95 (talk) 23:19, 7 July 2020 (UTC)

Duplication of coordinates

Template:Infobox bridge gets the coordinates of the bridge from wikidata but this information is displayed twice on the article. Once in the top-right corner and again inside the infobox (example). This seems a bit excessive - is there something wrong with how this template is coded? — Martin (MSGJ · talk) 09:48, 22 September 2020 (UTC)

That is normal for many coordinate displays. See the "display" section of the documentation for {{Coord}}. What you are seeing is the "inline,title" option, which is used in many articles where infoboxes display coordinates. I think many editors are used to looking at the top right of the article for coordinates as a consistent location. – Jonesey95 (talk) 14:58, 22 September 2020 (UTC)
I guess I haven't noticed it before. I think standardisation is important, and I also think it is excessive to display it twice. Have there been any discussions about this? Is it mentioned in the manual of style? — Martin (MSGJ · talk) 08:19, 23 September 2020 (UTC)
I don't know of any discussions or guidelines. I think it's just something that has always happened. There are some infobox templates that manage to suppress the coordinates, and the "Coordinates" header, in the infobox when "display=title" is used in the coord template. I'd have to dig around for one, though. – Jonesey95 (talk) 15:14, 23 September 2020 (UTC)
Many, many articles use "inline,title" and show the coordinates at top-right and in the infobox. It looks a bit odd in Jarrow Bridge because the infobox is minimal with coordinates at the top of the text, but it is standard. Check articles for major cities, e.g. Paris. Johnuniq (talk) 01:51, 24 September 2020 (UTC)

@Jonesey95: please can you advise at Template talk:Infobox bridge#Multiple coordinates? Some articles already have {{coord}} and the infobox is duplicating the coordinates in the top-right corner, which is not good. — Martin (MSGJ · talk) 17:28, 24 September 2020 (UTC)

change needed

this change needs to be done --Ookrainer (talk) 17:51, 9 December 2020 (UTC)

 Not done: Lots of problems with this change. First of all, it makes convert_dms2dec ignore its direction parameter. If we don't want to use a direction parameter anymore, it should be removed, not just ignored. Also, your addition of " or 0" to the degrees case means that pages with malformed coordinates will end up claiming they're on Null Island rather than giving an error. As for the other changes, what specific problem are they solving? Jackmcbarn (talk) 21:43, 9 December 2020 (UTC)
Jackmcbarn, why does it make convert_dms2dec ignore its direction parameter? I am just purifing it by
direction = mw.ustring.gsub(direction, '^[ ]*(.-)[ ]*$', '%1');

an addition of " or 0" to the degrees is not always useful, here I can agree with you. --Ookrainer (talk) 21:58, 9 December 2020 (UTC)

@Ookrainer: You're right about the direction parameter, now that I look at it again. I misread what the gsub was operating on. But anyway, my other question still stands: how are these changes an improvement? Jackmcbarn (talk) 03:41, 10 December 2020 (UTC)

Updating Coord2text

@Evad37 and Jackmcbarn: The updates to Coord2text in Module:Coordinates/sandbox seem to work for the most part, however it's not rounding the dms conversion like it used to. See Template:Coord/testcases#Coord2text for examples. Also, instead of parsing the coordinates from the geohack URL, would it be possible to parse them from the spans instead (like was done in Module:Location map)? That should make it more future-proof. Kaldari (talk) 04:58, 8 December 2020 (UTC)

@Evad37 and Jackmcbarn: Due to the frequent changes to Module:Coordinates/sandbox, I moved our working test version to Module:Coordinates/sandbox2. The testcases at Template:Coord/testcases#Coord2text have also been updated. As you can see there, the dms converted results are not being rounded properly, but I imagine that would be easy to fix. Kaldari (talk) 00:18, 15 December 2020 (UTC)

Update the microformat

The good people on microformats.org are quite unhappy at the way geo is handled on Wikipedia, to the extent that I had no idea how to start a (globe) proposal with the "we need it on Wikipedia" justification. Some of the issues are:

  1. Outdated "geo" format. They prefer hGeo now, where the class names are a lot more consistent.
  2. Some data are nonsense, esp. when we do globe:

Now that Wikipedia:WikiProject Microformats have switched to the h- classes for everything but geo, it makes sense to move geo to the newer h-geo spec too.

--Artoria2e5 🌉 06:32, 8 March 2021 (UTC)

Straw edit request

Special:PermanentLink/1010953805 is my current attempt at updating the format using only minor tweaks without breaking backward compat. This fixes problem 1, but not yet problem 2. A procedure to parse the extra colon-style params into a dict is needed to fix 2. --Artoria2e5 🌉 06:32, 8 March 2021 (UTC)

 Not done: This is not how edit requests are to be used. It seems like you might want to start an RfC? Elli (talk | contribs) 21:36, 8 March 2021 (UTC)
I had in mind to look at this, thanks Elli for hitting the talk page for me. ;) Will look at some point in the next 24 hours. --Izno (talk) 00:46, 9 March 2021 (UTC)
@Artoria2e5: Your update seems to have broken coord2text. See the module testcases. --Izno (talk) 18:28, 10 March 2021 (UTC)