Template talk:Infobox settlement

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Enabling wikidata[edit]

@PC-XT, Jackmcbarn, Mr. Stradivarius, and Unbuttered Parsnip: I have started enabling the ability to pull information from wikidata, and it's almost working. I have started with the coordinates. if you check this version of Madridejos, Cebu, you will see that it is able to correctly render the location map, and it does display coordinates, but the optional args are not being parsed. I imagine this could be fixed with minor changes to module:coordinates? basically, I would like to be able to pass |type=, |format=, and |display=. currently, the automatic wikidata usage is only enabled when |coordinates_wikidata=yes or any nonblank value. it could be useful to make this happen automatically, just by omitting the coordinates from the infobox, but I believe this template has been used in cases where it isn't the primary infobox, so having a flag to turn on the feature seems useful. by the way, if you check the source for Madridejos, Cebu it looks like there is more we could pull from wikidata, but I figured we should start with the coordinates. another option would be to integrate the wikidata feature with {{geobox coor}}? Frietjes (talk) 15:07, 28 February 2015 (UTC)

I'm sick, but I'll try to track down the parameter problem in the next few days, if someone else doesn't do it, first. I'm wondering if switching it to use module:arguments would help? —PC-XT+ 04:04, 1 March 2015 (UTC)
Can the undue precision of coordinates shown in your example be controlled? Is any consideration given to pass parameters like _dim: and _scale:? -- Michael Bednarek (talk) 07:32, 1 March 2015 (UTC)
good question. having the 'format=dms' work will partially address this problem, but it would be good to make this even more robust. Frietjes (talk) 14:53, 1 March 2015 (UTC)
Frietjes, does it work to invoke module:coordinates/sandbox, instead of the main module? I remember fixing a similar issue in that sandbox, but I don't think it was applied. One testcase is failing, now, which I don't remember failing then, so I'm not sure it can be applied until that is explored. I'll try to look at it better, tomorrow. —PC-XT+ 03:54, 4 March 2015 (UTC)
PC-XT, that version seems to work if I pass the type using |3=, see this version of the sandbox. Frietjes (talk) 14:43, 4 March 2015 (UTC)
Frietjes, yes, |type= is not supported, but is tracked by Category:Pages with malformed coordinate tags. I could add support to the sandbox, but I'm unsure if the tracking is due to consensus against such implementation, or if it was merely carried over from the template code. If |3= is inconvenient, perhaps a floating alias of some kind could be added so the module can handle cases in which |3= may or may not hold a part of the coordinates, but that doesn't appear to be an issue in this case? Otherwise, |format= seems to be working properly. |display= should work, but I don't see it being used in this template sandbox? The failed testcase is due to combining two spans. One was only applying a style and the other only an id, so I don't see that as a problem. —PC-XT+ 18:46, 4 March 2015 (UTC)
PC-XT, yes, using |3= works for me. the only other lingering issue would be a method for reducing the excessive precision when |format=dec. however, that's a less critical problem, since it appears most articles where this will be deployed use |format=dms. so, in summary, if it's possible to update the main template, please do so, and I will start documenting the new feature. Frietjes (talk) 18:52, 4 March 2015 (UTC)
Frietjes, I've opened the edit request. —PC-XT+ 19:23, 4 March 2015 (UTC) Link: Module talk:Coordinates#Flummoxed —PC-XT+ 21:51, 4 March 2015 (UTC)

@Frietjes: Great work to get the coordinates to work with Wikidata! I noticed one small thing: the coordinates are no longer in the title (even if coordinates_display = title,inline). Can you correct that? Thanks. -- P 1 9 9   20:15, 12 March 2015 (UTC)

PC-XT, fixed, forgot about the differing syntax with geobox coor. note that we now have a similar feature with infobox airport. I plan to add it to {{infobox islands}} as well. it might be good to simply add this to {{geobox coor}} instead? Frietjes (talk) 20:34, 12 March 2015 (UTC)
I'm glad to see {{geobox coor/sandbox}} calls the module directly, instead of wrapping the template. —PC-XT+ 23:48, 13 March 2015 (UTC) You might want to include the #coordinates parser function when not pulling from wikidata, since Lua may still have issues handling it. Does anyone know that phabricator bug? I couldn't find it. Maybe I'm doing the search wrong. I had trouble with the # sign corrupting the url. I did find it mentioned at Template talk:Coord/Archive 11#Wikidata tracking, though. —PC-XT+ 01:31, 14 March 2015 (UTC) Phab:T65597 is marked as resolved. Is that the only one affecting this case? Should we try it in Lua, again? —PC-XT+ 02:07, 14 March 2015 (UTC)
User:PC-XT, I created module:geobox coor to address the problem with the wikidata returning excessively precise numbers. basically, someone needs to fix the conversion from dms to dec to round the result or module:coordinates won't be able to determine the precision before the conversion. so, until this is fixed, I just put a hack in module:geobox coor to round the results for module:coordinates. do you know where we can file a request for changing the dms to dec conversion when the coordinates are pulled from wikidata? Frietjes (talk) 17:15, 14 March 2015 (UTC)
Frietjes, I copied your wikidata rounding function to Module:Coordinates/sandbox and added something similar to what I expect wikidata and {{#property:P625}} use to round coordinates, with help from wikidata:Property talk:P625#Special precision. In most cases, this method should give the same results as yours, but 0s could be left in, if such precision is specified on wikidata. Since wikidata precision may be null, it should probably fall back on your function. Documentation is sparse, and I am not sure this formula is appropriate for use in this module, so it can be fixed or reverted to just use your function as needed. One fix I am considering is a custom rounding function for cases where dms output format is requested and the wikidata precision suggests it, to avoid rounding error. Any thoughts on any of this? —PC-XT+ 23:39, 14 March 2015 (UTC)
User:PC-XT, ha, I didn't know about the precision property. I changed module:geobox coor to use that instead of my hack. if that method doesn't work, it just falls back to not rounding the coordinates. I think we can do the same with module:coordinates, and remove the hack from there as well. once the live coordinates module uses the precision property, I can then completely remove the wikidata-specific stuff from module:geobox coor and just have module:coordinates do it instead. thanks for the help, I can't believe I missed this feature. Frietjes (talk) 16:20, 15 March 2015 (UTC)
Yeah, it was hard to find. I did the same to module:coordinates/sandbox and put in the edit request. As for rounding error, dms coords seem to round to more decimal precision, so that shouldn't be a problem. I was considering other changes like accepting the type from |3=, |5=, |7=, or |9= when using wikidata, but they can be discussed, first. I'm glad I could help. You always do so much to help others. —PC-XT+ 04:53, 16 March 2015 (UTC)

Template-protected edit request on 6 March 2015[edit]

Please update from sandbox to remove the twin* parameters per the 2012 consensus. Alakzi (talk) 01:12, 6 March 2015 (UTC)

Any take on why this edit wasn't performed three years ago? – Paine EllsworthCLIMAX! 11:03, 9 March 2015 (UTC)
John, would you know? Alakzi (talk) 12:27, 9 March 2015 (UTC)
Red information icon with gradient background.svg Not done for now: Pending a response to the question at hand. — {{U|Technical 13}} (etc) 01:52, 12 March 2015 (UTC)
It's been nearly four days already; I don't think we're getting one. Is anybody now opposed to this change? Alakzi (talk) 02:05, 12 March 2015 (UTC)
done. Frietjes (talk) 20:10, 12 March 2015 (UTC)