Malldiskussion:KML

Sidans innehåll stöds inte på andra språk.
Från Wikipedia

Rödlänkning diskussion[redigera wikitext]

Mallens rödlänkningen av Diskussion i annars genomarbetade artiklar ger intrycket att något är ofärdigt i artikeln de läggs in i. Går det att på något sätt neutralisera denna färg? I annat fall tycker jag att de långa texterna kan ersättas med v, d och r exempelvis i Mall:Sjöfart i Stockholm. Där lyser det inte lika mycket. I99pema (diskussion) 12 april 2014 kl. 11.50 (CEST)[svara]

Håller med om att det ser illa ut med den stora röda texten. I tidigare diskussion gjorde jag det här förslaget:
Kartdata:
v • d • r
Se kartdata överlagrat på...
Google Maps Bing Maps
Kanske någon del från det kan användas. --Larske (diskussion) 12 april 2014 kl. 12.26 (CEST)[svara]
Den mallen tycket jag är tydligare vad det handlar om för någon som inte stött på detta tidigare. Skulle gärna se att den tightades i hop något i höjdled om det går? Hur ser den ut med vit bakgrundsfärg?--I99pema (diskussion) 12 april 2014 kl. 12.39 (CEST)[svara]
Så här?
Kartdata:
v • d • r
Se kartdata överlagrat på...
Google Maps Bing Maps
--Larske (diskussion) 12 april 2014 kl. 13.24 (CEST)[svara]
Ja, eller kanske till och med så här:
Kartdata:
v • d • r
Se kartdata överlagrat på...
Google Maps Bing Maps
--I99pema (diskussion) 12 april 2014 kl. 15.09 (CEST)[svara]
I stället för "v d r" kunde det kanske räcka med en länk till KML-sidan. Den som vill spara KML-filen kan ju enkelt göra det med de data som finns där. Diskussionssidan nås också enkelt från KML-sidan. Edaen (diskussion) 12 april 2014 kl. 16.29 (CEST)[svara]
Ja, det är enklare och bättre. Så här:
Kartdata Se kartdata överlagrat på...
Google Maps Bing Maps
--Larske (diskussion) 12 april 2014 kl. 16.44 (CEST)[svara]
Fint. Kan vi byta plats på "Se kartdata" och "Kartdata". Den ovana läsaren lär klicka på länkar längst till vänster först och kan bli förvirrad om själva datan är det första som möter.I99pema (diskussion) 12 april 2014 kl. 17.08 (CEST)[svara]
Jag var inne på samma tanke:
Se kartdata överlagrat på...
Google Maps Bing Maps
Kartdata
--Larske (diskussion) 12 april 2014 kl. 17.17 (CEST)[svara]
Tycker det ser bra ut enligt test nedan. Enda som saknas är möjligheten till indrag med asterisk. --I99pema (diskussion) 12 april 2014 kl. 18.11 (CEST)[svara]

Test[redigera wikitext]

Se kartdata överlagrat på...
Google Maps Bing Maps
Kartdata

Test 2[redigera wikitext]

Se kartdata överlagrat på...
Google Maps Bing Maps
Kartdata

--Larske (diskussion) 12 april 2014 kl. 18.50 (CEST)[svara]

Tumme upp av mig!I99pema (diskussion) 12 april 2014 kl. 19.00 (CEST)[svara]
Kan vi ersätta befintlig, eller bör vi invänta ytterligare kommentarer (själv osäker på hur man ersätter) ? --I99pema (diskussion) 14 april 2014 kl. 09.03 (CEST)[svara]
För min del går det bra. Edaen (diskussion) 14 april 2014 kl. 09.12 (CEST)[svara]
Någon som kan ändra koden? --I99pema (diskussion) 18 april 2014 kl. 18.41 (CEST)[svara]
 Fixat. Jag tog också bort class="boite-grise boite-a-droite noprint" som jag misstänker är en verkningslös rest från frwp. --Larske (diskussion) 18 april 2014 kl. 20.24 (CEST)[svara]

Det går inte att lägga en asterisk för punktform framför mallen. Någon som vet hur detta fixas?--I99pema (diskussion) 12 april 2014 kl. 11.54 (CEST)[svara]

 Fixat (om det var så du menade...).--Larske (diskussion) 12 april 2014 kl. 12.17 (CEST)[svara]

Automatiskt inlagd i Ortfakta Sverige[redigera wikitext]

Jag har (efter vissa missöden) lagt in så att KML-datan automatiskt läggs in i {{Ortsfakta Sverige}}. Om det funkar och ser bra ut kan man ju tänkas lägga in det i fler ortsfaktamallar. -- jiˈesˌdeːo ] 21 april 2014 kl. 16.16 (CEST)[svara]

Det ser ut att fungera nu. Jag kompletterade koden så att faktarutan endast syns för de artiklar där det finns någon KML-data att visa upp, till exempel för Malmö. --Larske (diskussion) 21 april 2014 kl. 16.29 (CEST)[svara]
Ah. Det blir ju perfekt. Men är det inte bättre att lägga in ifexist-koden i Ortsfakta Sverige? På så sätt anropas inte mallen alls. -- jiˈesˌdeːo ] 21 april 2014 kl. 16.38 (CEST)[svara]

Orienteringstext[redigera wikitext]

Det står: "Se kartdata överlagrat på Google Maps..." vilket är lite obegriplig för den oinvigde. Jag skulle vilja förtydliga denna helt utmärkta länk med t.ex.: "Se kartdata med områdesgränser överlagrat på Google Maps...". Hälsningar --Holger.Ellgaard (diskussion) 23 april 2014 kl. 09.35 (CEST)[svara]

Botskapade KML-filer[redigera wikitext]

Jag tänker börja generera KML-filer med Lsjbot, i första hand för sjöar - se Användardiskussion:Lsjbot/Projekt alla platser#Sjöarealproblematiken - åtminstone finska data är så osäkra att de tyvärr måste tas bort. Dessa ska först användas för kontroll och felsökning, men när jag ändå gör dem är det väl lika bra att göra dem åtkomliga för den här mallen. Men boten kommer ju snabbt att fullständigt dränka listan med KML-filer, vi talar om hundratusentals filer. Ska vi bara låta den göra det, eller går att lägga de botskapade filerna någonstans separat och organiserat, men ändå åtkomliga för mallen? Lsj (diskussion) 21 augusti 2016 kl. 19.54 (CEST)[svara]

Det har skett förändringar på den engelska motsvarigheten sedan importen. Det kanske kan vara idé att någon med kodkunskap tar en titt på det och ser om det finns något som bör inspirera den här mallen. Edaen (diskussion) 21 augusti 2016 kl. 19.58 (CEST)[svara]
För stunden funkar det att använda den fram tills nyss odokumenterade parametern "sida=" och lägga de robotskapade någon annanstans. Jag har valt att lägga dem under Wikipedia:RobotKML. Jag har också kommit på hur man lägger in Wikipedia-kategorier i KML-filer utan att det blir syntax error vare sig här eller där :) - se Kategori:KML. Lsj (diskussion) 1 september 2016 kl. 18.55 (CEST)[svara]

Hello. Sorry for writing this in English, but I don't actually understand other languages; and I see that multiple users who commented above indicate on their userpages that they understand some English (Lsj, Edaen, Holger.Ellgaard). The recent creation of d:Property:P3096 on Wikidata means that any wiki can now access more than 10,000+ KML files specified on Wikidata, regardless of which wiki the KML file is located on. This is achieved by using a Lua module to retrieve the KML file location from Wikidata. Such a module is already in use on a few wikis, see the links from d:Q26689774. I have started such a module here at Modul:KML (but I used Google translate to do the translations in the "Localisation (L10n) settings" section, so they may need to be fixed). I have created Användare:Evad37/sandlåda/KML as a sandbox version of Mall:KML, with testcases on Användare:Evad37/sandlåda. As shown there, the new code is able to detect errors (and it will put articles into categories, so that the errors can be found). If you decide to upgrade this template to use Wikidata and the module, then this template should be replaced with the following code:

<includeonly>{{#invoke:KML|main}}</includeonly><noinclude>{{KML|demo=yes}}
{{Dokumentation}}</noinclude>

Cheers, and happy editing! (and again, apologies for writing this in English; I have included a machine translation below) - Evad37 (diskussion) 13 september 2016 kl. 08.55 (CEST)[svara]

From translate.google.com / från translate.google.com: Hallå. Ledsen för att skriva detta på engelska, men jag faktiskt inte förstå andra språk; och jag ser att flera användare som kommenterade ovan visar på deras userpages att de förstår vissa engelska (LSJ, Edaen, Holger.Ellgaard). Den nyligen bildade d:Property:P3096 på wikidata innebär att alla wiki nu kan få tillgång till mer än 10.000 KML-filer som anges på wikidata, oavsett vilken wiki KML-filen ligger på. Detta uppnås genom att använda en Lua modul för att hämta KML-filen plats från wikidata. En sådan modul är redan i bruk på några wikis, se länkar från d:Q26689774. Jag har startat en sådan modul här på Modul: KML (men jag använde Google translate att göra översättningar i "Localisation (L10n) settings" avsnittet, så att de kan behöva fast). Jag har skapat Användare:Evad37/sandlåda/KML som en sandlåda version av Mall:KML, med testfall på Användare:Evad37/sandlåda. Som framgår där, kan upptäcka fel den nya koden (och det kommer att sätta artiklar i kategorier, så att felen kan hittas). Om du väljer att uppgradera denna mall för att använda wikidata och modulen, då denna mall bör ersättas med koden som visas ovan. Skål och glad redigering! - Evad37 (diskussion) 13 september 2016 kl. 08.55 (CEST)[svara]
I updated the template per the above, as there were no comments or objections after several days - Evad37 (diskussion) 17 september 2016 kl. 08.41 (CEST)[svara]
@Evad37: Please note that your changes to the template have resulted in breakdown of several thousand pages, see A P M Aeration Pond for an example. --Larske (diskussion) 17 september 2016 kl. 08.57 (CEST)[svara]
@Evad37, Lsj: Please note that this template has an optional parameter sida that is not supported by the KML module. This parameter is used in many thousands articles created by Lsj by the use of Lsjbot. I thus reverted the template back to its previous functionality and hope that the module can be modified to take care of the sida parameter. Alternatively Wikidata needs to be updated with the KML-files (P3096) for all these objects before the module is used on svwiki and Lsjbot needs to be changed to update Wikidata (P3096) as well for its future article creations. --Larske (diskussion) 17 september 2016 kl. 09.42 (CEST)[svara]
@Evad37: Now I see that the parameter sida is in fact handled by the module. The problem is that the "kml_prefix" (i.e. "Wikipedia:KML/") is prepended to the parameter value and that is not compatible to the way the template works. The parameter sida already contains the kml_prefix. So i guess there is just a simple fix needed on the below two lines in the module:
wikiLink = Args[L10n.para.from] or mw.title.new(tostring(mw.title.getCurrentTitle())).text
wikiTitle = mw.title.new( L10n.str.kml_prefix .. wikiLink ) 
so the "from-case" is not threated like the "CurrentTitle-case" when it comes to the kml_prefix.

--Larske (diskussion) 17 september 2016 kl. 10.01 (CEST)[svara]

Thank you for noticing, Larske, and for investigating the issue. I have adjusted the module, so that it knows that |sida= will already contain the prefix. I have updated the tests at Användare:Evad37/sandlåda accordingly. You can add more tests to that page if you want. - Evad37 (diskussion) 17 september 2016 kl. 11.33 (CEST)[svara]
@Lsj: Would it be possible for Lsjbot to update Wikidata items with P3096? Or maybe just output a log of articles and their corresponding KML file, so that I can use semi-automated tools to update Wikidata? - Evad37 (diskussion) 17 september 2016 kl. 11.48 (CEST)[svara]
Without answering your question, I would say, at the moment, a huge part of the bot-generated kml's are of far less quality than necessary for having them spread to other projects or even articles without being checked by a human eye. For the moment Lsj is putting a lot of efforts to find methods able to discriminate between good and bad ones, but still the bad ones are not yet discarded. 17 september 2016 kl. 12.29 (CEST) To be anonym was not my intention, sorry... Taxelson (diskussion) 17 september 2016 kl. 13.31 (CEST)[svara]
As already noted by the anonymous commentator above, the current KML files generated by the bot are for testing purposes only. After we sorted out the quality issues, the bot can make a log of KML-files. But Lsjbot does not run on wikidata, and I have no immediate plans to go through the hassle of negotiating a bot flag there and learning a new set of tools. Lsj (diskussion) 17 september 2016 kl. 13.23 (CEST)[svara]
Thanks Lsj, I understand now. I'll wait until the quality issues are fixed. Once that happens, if the bot then makes a log, I can use other tools to update Wikidata myself. (If you could please leave me a message on my talk page to remind me, after everything is sorted). - Evad37 (diskussion) 18 september 2016 kl. 12.04 (CEST)[svara]

Now that the |sida= issue has been fixed[1], and Larske has improved the translations[2], is it okay to make this template use the module again? - Evad37 (diskussion) 18 september 2016 kl. 12.04 (CEST)[svara]

This looks like a typo:
sites[10] = { "svwiki", "sv.wikipedia.org", "w:sr:" }
If intended, maybe a comment could be inserted to explain why "sr" instead of "sv".
As pointed out by Lsj and Taxelson the robot generated KML-files are just for testing purpose and with "varying" quality.
I wonder if not the best way forward would be to skip the cross-wiki KML-exports and just have Wikidata/P3096 as the only KML reference with local KML file as the only exception. Or maybe a parameter to the module that can turn on/turn off the cross-wiki KML-export feature. What do you say?
--Larske (diskussion) 18 september 2016 kl. 12.53 (CEST)[svara]
Yes, that is a typo, fixed[3]. As I mentioned above, I won't be looking to export robot generated KML-files until quality issues are sorted out. I'm not sure I understand your last point ("...skip the cross-wiki KML-exports and just have Wikidata/P3096..."). Wikidata's P3096 only allows the module to find KML files on other wikis. The way the module works is to look at the Wikidata item for the article, use the P3096 statement to find the item for the KML file, and then find the actual KML file by looking at the pages connected to the KML file's item – preferably from the local wiki, but otherwise from any wiki of the wikis listed in the module, in sites[2] to sites[11]. For example, the article Interstate 5 has the Wikidata item d:Q54725; the Q54725 item has P3096→d:Q26329614; the Q26329614 item has no page on svwiki, but does have a page for enwiki: https://en.wikipedia.org/wiki/Template:Attached_KML/Interstate_5 so the module uses that KML file in the link; i.e. it would output these links:
  • Se kartdata överlagrat på Google Maps (Kartdata (redigerahjälp))
  • KML is from Wikidata
    unless |sida was specified. When |sida is specified, the module doesn't even look at Wikidata, it just uses the page specified. So the choice isn't "Wikidata P3096, or local files, or cross-wiki files", but is actually "local files or cross-wiki files".
    To give another example where a KML files does exist on svwiki: the article Central Park has wikidata item d:Q160409 with P3096→d:Q25033552. That item has 3 links: enwiki, svwiki, and zhwiki. Since svwiki is the local wiki, the module will use the svwiki page https://sv.wikipedia.org/wiki/Wikipedia:KML/Central_Park to generate these links:
  • Se kartdata överlagrat på Google Maps (Kartdata (redigerahjälp))
  • KML is from Wikidata
    Does that help explain the situation? - Evad37 (diskussion) 18 september 2016 kl. 13.56 (CEST)[svara]
    Thanks for your explanation, I should have looked better in Wikidata/P3096. I just assumed that P3096 was (part of) an URL pattern, like e.g. P18 and P214, that pointed to "one and only one" KML-file. --Larske (diskussion) 18 september 2016 kl. 15.15 (CEST)[svara]

    So, are there any remaining concerns (about making the template use the module)? - Evad37 (diskussion) 19 september 2016 kl. 16.24 (CEST)[svara]

    I guess we need to think a bit about the categories that articles are possibly put into by the module. Some of them should probably be created before the module is put into operation as we don't like non existing categories to appear as "red links" in the footer of articles. These categories should probably also be made HIDDEN, i.e. only visible if requested in personal settings. The fact that an article belongs to e.g. "Artiklar med KML som inte hämtas från Wikidata" is a kind of "design information" and not of any interest to the normal visitor/reader of an article. --Larske (diskussion) 19 september 2016 kl. 17.28 (CEST)[svara]
    Yes, that's the way its done on other wikipedias. On enwiki the categories use w:en:Template:Hidden category (Mall:Dold kategori), and are also marked as a "tracking category" using w:en:Template:Tracking category (but there doesn't seem to be an equivalent template here). The error category on enwiki also has w:en:Template:Empty category to notify admins that it shouldn't be deleted if it happens to be empty, but again there isn't an interwiki link to a similar template on svwiki. - Evad37 (diskussion) 20 september 2016 kl. 02.04 (CEST)[svara]
    I've created the categories, with what I think are the appropriate templates, see Kategori:Artiklar med KML som hämtas via Wikidata, Kategori:Artiklar med KML som inte hämtas från Wikidata, Kategori:KML-fel - Evad37 (diskussion) 22 september 2016 kl. 06.25 (CEST)[svara]
    @Larske: - Evad37 (diskussion) 23 september 2016 kl. 03.48 (CEST)[svara]
    @Evad37: Looks fine to me. --Larske (diskussion) 24 september 2016 kl. 01.03 (CEST)[svara]

    Problem with the module[redigera wikitext]

    @Evad37, Larske: The page Användare:Lsjbot/Kartrutor has stopped working. It makes many calls to {{KML}}, and it used to work just fine. Now some KML calls work, some give error messages, and at some point halfway through the page it stops working altogether, complaining about "Luafel: too many expensive function calls." Lsj (diskussion) 28 september 2016 kl. 21.18 (CEST)[svara]

    @Evad37, Lsj: The error message "KML-fil hittas inte,..." is a "helpful feature" pointing out that the stated KML-file does not exist. As you can see here there is no KML-file for N65E029, and when you try to use it, like this:
    {{KML|sida=Wikipedia:RobotKML/Kartrutor/FI-sjö-N65E029}}
    you will get the following result (with an error message):
    There is a limit on 500 "expensive function calls" per page. If the page is divided into one subpage per country, like Wikipedia:RobotKML/Kartrutor/Finland etc, the number of calls will likely be below 500 per subpage. Would that be possible for Lsjbot? --Larske (diskussion) 28 september 2016 kl. 23.30 (CEST)[svara]
    --Larske (diskussion) 28 september 2016 kl. 23.30 (CEST)[svara]
    Splitting into subpages would solve the problem. Another option if you didn't want to split the page would be to recreate an old version of the template (at Mall:KML/old or a similar title) and use that instead of KML on Användare:Lsjbot/Kartrutor. - Evad37 (diskussion) 29 september 2016 kl. 01.45 (CEST)[svara]
    I've created {{KML-nowd}}, which solves the problem. Lsj (diskussion) 30 september 2016 kl. 09.04 (CEST)[svara]

    Upptäckt fel[redigera wikitext]

    Under dagen har jag blivit varse att denna mall inte fungerar. Meddelandet som dyker upp när osm.quelltextlich.at öppnas i en ny flik är: "osm.quelltextlich.at says, File caching error: url download error (Error code: 4)." //LevandeMänniska (diskussion), 29 augusti 2022 kl. 15.35 (CEST)[svara]

    Det verkar vara kopplat till "nationella tecken". Mallen fungerar för Tensta och Tavastehus, men inte för Gärdet och Åbo.
    -- Larske (diskussion) 29 augusti 2022 kl. 15.48 (CEST)[svara]
     Fixat Det verkar som ett anrop av "urlencode" gjorde susen, nu fungerar mallen även för Gärdet och Åbo. Larske (diskussion) 29 augusti 2022 kl. 15.59 (CEST)[svara]