Module talk:Coordinates/Archive 2
![]() | This is an archive of past discussions about Module:Coordinates. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 |
TPE on 11 Sep 2016
![]() | This edit request to Module:Coordinates and Template:Coord has been answered. Set the |answered= parameter to no to reactivate your request. |
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)
- Synced module and template. Ping/reopen if there are pending issues, cheers — Andy W. (talk · ctb) 15:50, 13 September 2016 (UTC)
- @Andy M. Wang: Removing edit request; there are a few changes I'd like to make to the
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)
- Synced again, didn't find any other compatibility issues — Andy W. (talk · ctb) 04:59, 22 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}}
- @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}}
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. 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. 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 (talk • contribs) 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 (talk • contribs) 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 (talk • contribs) 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)