Jump to content

User talk:Yurik

Page contents not supported in other languages.
Add topic
From Wikivoyage
Latest comment: 7 years ago by Matroc in topic GPX Files, Geoshapes and other things

An award for you!

[edit]
The Wikivoyage Barncompass
Thanks for your work on the new maps, and moreso for being amazingly responsive to bug reports. I expected it would take a couple of days to resolve the mapmask issue, but I think you had it fixed in a matter of hours - truly impressive and appreciated. -- Ryan (talk) 15:53, 10 June 2016 (UTC)Reply
Thank you Ryan! I'm sure I will be breaking things frequently in the next few days as I make more changes to the map, so keep sending feedback and bug reports :) --Yurik (talk) 15:58, 10 June 2016 (UTC)Reply

Listing and maps

[edit]

Please stop experimenting in Listings and Map templates. Let have a new method that is not a regression before going live. --Traveler100 (talk) 14:21, 12 June 2016 (UTC)Reply

Traveler100, did I break something? Most changes are being done after being tested. --Yurik (talk) 14:22, 12 June 2016 (UTC)Reply
We have lost functionality on the maps, messed up listing numbers on itineraries and appear to be added a new method to listings without discussion. --Traveler100 (talk) 14:24, 12 June 2016 (UTC)Reply
Traveler100, the new method on listing was specifically added to fix the itinerary. Check out Rheinsteig and Wales_Coast_Path. Maps have been enabled on Wikivoyage for months for experiments. Now I switched it over, and I am rapidly fixing all the minor cases that were not noticed before. If I was to start a discussion about each tiny change with template parameters, we would never get anything done (that's why Nupedia failed and Wikipedia succeeded, also be bold). If you think something specific should be changed or altered or is being done badly, sure, lets discuss it on the forum :) --Yurik (talk) 14:42, 12 June 2016 (UTC)Reply

Introduction of myself and Kartographer proposals

[edit]

Besides DerFussi I am one of the admins and programmers at WV/de. Because we are very busy I can contact you only today. Now we are checking the opportunities of the Kartographer, and we partly implemented it. After my first checks I added three tasks shown beside.

A more complicated question is where to store tracks and masks. At WV/de we use GPX subpages, at WV/en GPX templates are used. I do not like these declarations. I prefer a storage at Wikidata including imports and exports of GPX and other track data. These data could be used on all WV branches and WMF projects. We should discuss with the Wikidata community and programmers how to implement this.

We should involve User:Mey2008 because he is the programmer of the tools which are in use up to now and therefore an expert on maps. Unfortunately he is now confronted with problems and bugs using the Kartographer extension but he needs additional information which is not yet documented.

An important feature for all communities is a map showing nearby articles. We need it to change over to the Kartographer. Is it possible to make nearby information available on WV/de, too? --RolandUnger (talk) 14:22, 12 July 2016 (UTC)Reply

RolandUnger, thanks for your note and tasks! I have proposed two solutions for the GPX: storing GeoJSON data in dedicated pages on Commons phab:T137930 (accessible from all wikis), and getting data directly from the OSM database (see demo). The nearby articles feature exists in English, and will work the same way in German WV. It downloads the data from the existing maps service. --Yurik (talk) 17:30, 12 July 2016 (UTC)Reply
Today I added a workaround (show parameter) to the {{Marker}} template so all markers are now shown if you click on a marker symbol. --RolandUnger (talk) 04:44, 13 July 2016 (UTC)Reply
RolandUnger, I think we should delete all (or at least most) of the parameters instead of adding them. Module:Map can handle "parent" arguments, which means that the {{marker}} may contain almost no parameters, and the {{listing}} or {{see}} could specify all the needed stuff. Example: User:Yurik/Sandbox/Nested2 (which uses User:Yurik/Sandbox/Nested1 - that has no arguments). Of course that means we might need to rethink the structure of the templates - because it can only support two levels -- User:Yurik/Sandbox/Nested3 does not show debug information, but if it was using Nested1, it would. --Yurik (talk) 09:44, 13 July 2016 (UTC)Reply
I know that my additions could be only a workaround to generate a map behavior as expected. Done because some English-branch authors are angry about missing features and bugs of the Kartographer. I think that this is not mainly a problem of parent arguments – {{listing}} uses markers like stand-alone markers. Both templates, {{Marker}} and {{Mapframe}} which differ only in the map center position and zoom level, use now a default show argument with a big list of group ids. This problem will become bigger if we are introducing customizable markers. That's why I proposed task T140083 to introduce the all parameter for the show argument to simplify the specification of the show argument. Maybe it is a design bug of Kartographer to do not show all by default.
By the way, as of July 11, 2016 Mapquest stopped direct tile access. --RolandUnger (talk) 10:39, 13 July 2016 (UTC)Reply

Maps on hewikivoyage

[edit]

Hi Yurik, How can we update our maps on hewikivoyage to the new Kartographer's maps? Thanks, Dekel E (talk) 12:08, 16 July 2016 (UTC)Reply

@Dekel E: technically you don't need to do anything - just simply start using it as described in mw:Help:Kartographer. If you want some extra functionality, you might want to copy (adapt) MediaWiki:Kartographer.js. Lastly, if you already have some useful templates like {{see}}, you might need to change those templates a bit. I am still working on optimizing them here on en-wv, but it should get you started. Let me know if you have any problems. --Yurik (talk) 21:55, 17 July 2016 (UTC)Reply
@Yurik: What do I have to change on the listing templates? Don't I need to add something to Mapframe and marker templates? Thanks and sorry if you don't understand my English. Dekel E (talk) 07:25, 19 July 2016 (UTC)Reply
@Dekel E:, I will have to look at he-wiki to see what needs to be changed, but I won't have time to look at it any time soon - there are two conferences in Seattle this weekend, and I need to prepare for them. Plus we are enabling maps on hewiki, meta, cawiki, and possibly a few more - so that we can get some feedback. --Yurik (talk) 21:19, 19 July 2016 (UTC)Reply

No reaction on Phabricator tasks

[edit]

As you know I opened several tasks on Phabricator to improve the Kartographer. But it seems that there are no reactions. Some authors on the German Wikivoyage are really angry because of the bugs. For instance, today they asks why the autonumbering stops with 99 instead of 999. Please tell me what I can do to support you and the WMF. I ask you to contact user May2008 to improve the Kartographer. --RolandUnger (talk) 07:17, 26 July 2016 (UTC)Reply

RolandUnger, my apologies for not replying earlier. There was a big conference (SOTMUS) that we all attended in order to build better ties with the OSM community and figure out how to proceed with the map development. This is a fairly slow process simply because we only have 3 developers dedicated to the maps efforts, which includes infrastructure, features, and map quality. For comparison, Google map efforts have over 500. Moreover, I will be on vacation for a bit due to some family matters. I will attempt to answer all the pending phab tickets, but please be patient - maps is a very new WMF product, and we are still solving a large number of outstanding issues and missing functionality (that is mostly reported by users, for which I'm very thankful). Also, I hope WV DE community doesn't get angry just because the new functionality is not perfect from the start - it always takes some time to improve. --Yurik (talk) 04:33, 27 July 2016 (UTC)Reply
Of course I understand. But it is really difficult to explain authors from the English and German communities why things are not working now which were functional before. And some authors getting ugly. To prevent this I told you to contact May2008 because he was the programmer of the hitherto existing tools and has therefore the knowledge of a lot of problems. And I hope he will collaborate because he is angry, too. Because he was blew off and had to give support for a project he wasn't involved in.
Have a nice holiday with your family! --RolandUnger (talk) 05:29, 27 July 2016 (UTC)Reply
RolandUnger, I appreciate you reaching out to me. I feel we should have ways for the community to talk to the devs. If you look at the en-wikivoyage, there are hundreds of maps-related comments, and as you can see, most of them have my reply. You can imagine the time it took to answer those comments instead of coding, yet I still feel it was valuable because it gave me better understanding of what functionality was needed the most. That's why I am very happy that you reached out and summarized those issues as phabricator tickets - great help for me! This said, I have not really worked with DE community as I don't speak the language. Moreover, I was not involved in the migration, so I cannot really say what the issues are, how they are different from enwv, etc. I do hope that May2008 can talk to me so we can try to solve it - being angry without telling me is not very productive :) Lastly, just FYI - Mapquest stopped their tiles service, just in case you were using it. --Yurik (talk) 06:56, 27 July 2016 (UTC)Reply

GPX Files, Geoshapes and other things

[edit]

Privet (Привет):

  • User:Yurik/Sandbox/Gpx1 and User:Yurik/Sandbox/Gpx2 -- I took a quick look at them and fixed the LineString in some of the maps so that they would become visible - mostly the # was missing for the hex color codes in stroke:. I hope that was OK to do.
  • Trans-Siberian Railroad -- I converted the GPX file by hand to a maplink and put it on that article page so the routes would show on the mapframe in the article as a temporary measure until future work on GPX etc. has progressed. I think I did some notes on the Template Mapframe Talk page.
  • I did some minor conversion work of my own by reading the GPX template files and converting some of them to maplinks using a Lua Module. I noticed that there were some inconsistencies with the way they were written in the templates while coding to convert them... I remembered that you had done some work doing conversions so I stopped what I was doing. Most of them seemed fairly easy to convert. (I didn't do colors but randomly selected them.)
  • I often add or use a group name in a mapframe to avoid something like this: Group:_3658f0b2f530620d873fb17def72a85b00c53232 in the layers box.
  • Concerning Geoshapes:
    • Some GPX templates can also be converted to Polygon instead of LineString ie. Example: ANAHEIM GPX - Polygons can be coded to just show the line, a line and filled in area or a line and solid filled in area. Other tests can be seen on that page as well. Just a thought...
    • Geoshapes can use colors other than that dark gray/gray color
    • Multiple Geoshapes can appear on a mapframe along with POI's etc.
    • Not all external shapes exist yet for many places but I imagine that will improve as well
  • I also added some notes to mediawiki.org - talk Maps about some of the things I have been looking at or found.
  • Note that maplink with text="" is hidden on an article page.
  • Most of the things I have played around with are with maplinks though a lot of these elements can be or should be contained within a mapframe as features.
  • In the layers box in a mapframe on a map sometimes the layers are there and other times missing -- though when expanded to a full screen they are present. I keep thinking its a timing issue or because of some condition caused by the elements that go into creating it.
  • I hope you are doing well and not getting overwhelmed with all your hard work on maps etc. -- Matroc (talk) 05:05, 4 October 2016 (UTC)Reply
Matroc, awesome update!!! I will do one myself then :) You can now put SPARQL queries without URL encoding directly into the geojson (see examples). About GPX - try to see if you can find any of the geoshapes in OpenStreetMaps (a relation), and if it's there, make sure it has a Wikidata ID associated with it. This way you won't have to store the data on Wiki anymore, and there is a whole community maintaining the accuracy of that data. Also, in full screen mode there is now links to various external services if you click the "details" button at the bottom. We are actively working on getting mapframes to all of Wikipedias, hopefully it will be done fairly soon. Ping me with any specific questions, will be happy to answer. As always, any help with improving our documentation or suggestions is welcome :) --Yurik (talk) 22:32, 7 October 2016 (UTC)Reply
Geoshape group name; if exists, is not being picked up correctly for layers box on map -- rather the coding appears instead:
Group:{"type":"ExternalData","service":"geoshape","url":"https://maps.wikimedia.org/geoshape?getgeojson=1& .... и так далее - should be an easy fix -- Matroc (talk) 04:01, 16 October 2016 (UTC)Reply
Matroc, I'm sorry I do not understand what you mean. Could you give a full example of what's not working? Thanks! --Yurik (talk) 15:23, 16 October 2016 (UTC)Reply
Yurik - Travellers' Pub - Maps with extra layers on en-Wikivoyage - there is a map of India - open up the map to full screen - take a look at the layers box. Each of the geoshapes has a group=name but they do not appear. (Group mapshade for India and group Pakistan for Pakistan) - instead I see code or text for requesting their particular ids info for External Data geoshape - Same for your US map lower down the page and open it full screen -- Hope that helps... I figure there is a lot of work going on that caused this and would probably be rectified later - Matroc (talk) 21:40, 16 October 2016 (UTC)Reply
Matroc, thanks for reporting! I filed a bug, should be fixed soon. --Yurik (talk) 21:54, 16 October 2016 (UTC)Reply
  • Yurik - I do not really have any real knowledge in mathematics, algebra or trigonomety; but I learned a lot of new words!, I just wanted to pass along some information - I have created a function to draw circles for the openstreetmap that is displayed via mapframe. It appears to be fairly accurate for general use. Here are some examples. If you want to try it out on one of your sandboxes - here is a code sample - just put in whatever latitutude or longitutde you want to test (radius 10 is about 500km): <nowki>safesubst:#invoke:Sandbox/Matroc|circle|lat=21.35|long=70.07|type=poly|radius=10|fill=#000000}}</nowiki>
  • Someone had added Template:GPX/Monaco - I created a mapframe with those GPX coordinates should you wish to copy and modify to put in your Gpx2 Sandbox - note this has all of the elevations as markers as well. You may wish to remove remove them since they cover/hide the actual GPX route.
  • всего наилучшего! -- Matroc (talk) 07:11, 2 November 2016 (UTC)Reply
Matroc, the circle looks good! It sucks that geojson does not support it natively. My guess is that they figured it should be a "visual style of a single point", instead of drawing a circular geometry. Yet there is no easy way to do it for us. You might want to add that function to the module:map. The GPX is clearly a misnomer - its a hike in Monaco, not Monaco itself :) Feel free to modify the gpx2 sandbox. I hope to have a geojson storage on Commons soonish. --Yurik (talk) 14:00, 2 November 2016 (UTC)Reply
Monaco hiking trail added to gpx2 sandbox - minus all of the elevation markers (100+) -- Matroc (talk) 18:56, 2 November 2016 (UTC)Reply
Yurik - I was not sure of how to change my function to fit within the scope of the existing Module:Map (following the same code patterns); however, I did create Module:Mapdraw for the time being - this has function to draw a circle. I mentioned that I was working on drawing a circle etc. in the Pub but no one seemed to be interested in it for now. My Lua code would definitely scare anyone who writes decent code- ;) -- ps. I created a circle about 40 meters across and the center fell right on the target I was placing the circle around... Have a great day! -- Matroc (talk) 07:48, 5 November 2016 (UTC)Reply
Test module (moved to Module:Sandbox/Matroc/Mapdraw now has functions to draw circle, ellipse, box (square), kite (shield), rectangle, triangle, equilateral triangle, star, star2, hexagram, pointer, wedge, pentagon, hexagon, a simple line, diamond, crescent, octagon, decagon, boxframe, bbox, half circle, annulus (donut), rhombus, cross, X, bar and dot shapes . In addition, I have a rough distance calculator between 2 coordinates (miles and kilometers). Finally as an aside - I have a function that can take in the Template:Mapmask coordinates and convert them either to a mask or a geoshape for a mapframe or maplink. Concept is simply that the inverse of a mask is a geoshape (another source for geoshapes)... An interesting note is that when you use 2 or more masks separately, the darker the map display gets. (The solution would be to use MultiPolygon in one mapframe or maplink. (Samples are on the Module's talk page Module's talk page. Cheers! -- Matroc (talk) 00:06, 27 November 2016 (UTC)Reply
Note: MultiPolygon type works ok just a matter of square brackets; however, you can use Polygon with an array of shapes as well. - bbox does work and MultiPoint. You can make a Polygon and punch a hole in the middle too. Enough is enough I should leave you at peace... maybe 'til Christmas :) -- Matroc (talk) 07:50, 27 November 2016 (UTC)Reply
Mapdraw only has circle code - Sandbox/Matroc/Mapdraw has all shapes mentioned above. Updated my earlier notes above to reflect changes... Matroc (talk) 16:41, 8 December 2016 (UTC)Reply
Have been cleaning up code to match correct output format as well as embedding a comment to each geoJSON output with name of Module and a datetime stamp of when a shape is created -- Matroc (talk) 03:49, 27 December 2016 (UTC)Reply
Matroc, hi, be careful with time-based wiki markup (maplink/mapframe) generation - the generated geojson gets stored into "pageprops" database, and a hash of that data is used as the map (group) link. But sadly, pageprops may get regenerated later, without updating the hash (or the other way around - hash changes, but DB stays old). In short, i don't advise generating time-dependent geojson. In the other news, make sure to read about the new datasets feature - should be able to replace all your KML storage needs :) --Yurik (talk) 06:36, 27 December 2016 (UTC)Reply
This was an experiment to see if one could add a comment to the json output by adding extra data as a property... It is not going to be a permanent fixture of course. -- Glad to see more advancement in saving datasets on Commons - another goal realized. Will the names of the .map datasets be found in Wikidata? -- Cheers! -- Matroc (talk) 06:20, 28 December 2016 (UTC) -- ps. There is a long road ahead for this as there are only a few .map datasets in Commons available...Reply
Yurik -- Went back to take a look at datasets again and found that the section was either removed or archived. Thought you would like to know. -- Matroc (talk) 01:57, 30 December 2016 (UTC)Reply
Matroc what do you mean? Which section? --Yurik (talk) 16:33, 30 December 2016 (UTC)Reply
Yurik - Tabular and map data can now be stored on Commons was moved to Village_pump_(technical)/Archive_152 - Matroc (talk) 01:00, 31 December 2016 (UTC)Reply
Yurik - As a proof of concept only - one can draw alphabetical letters and place them on a map. Example located HERE... Cheers! -- Matroc (talk) 23:30, 12 June 2017 (UTC)Reply

"Wikidata" param & Wikivoyage maps

[edit]

Hi Yurik - I know that you are extremely busy, but if you have a chance I'd be grateful for your thoughts about my comments at the end of the Wikivoyage talk:How to use dynamic maps#Geoshapes service and other updates thread. I would like to update Module:Map and Template:Mapframe to add support for using the "wikidata" param to create a mapmask, but I am not clear whether Module:Map should be modified by anyone not on the maps team. Thanks! -- Ryan (talk) 04:07, 17 November 2016 (UTC)Reply

Ryan, oh, absolutely feel free to modify it! And terribly sorry for slow replies. About the wikidata support - there are three services at the moment - geoshape - polygon(s), geomask - inverted polygon(s), and geoline (road/river/...). I think your code only covers geoshape and geomask, not geoline. Also, you might want to support not just wikidata, but also wdqs param - a full query. Of course this also begs the question - is there a real need for changing the module? Would it be simpler to create a template like "Wikidata mapmask", which will add a maplink tag with text="" group="mask" and content being ExternalData + wikidata param? Also, you can make another template "Wikidata highlight" which will do the same but highlight a region? I think putting everything into one complex module, while having some positives, makes it so that only very few people will be able to understand/modify it. What do you think? --Yurik (talk) 08:05, 18 November 2016 (UTC)Reply
Thanks for the response. The examples provided were my first ever attempts to use Lua or the new maps code, so I'll look into cleaning up the implementation. I think there is value in allowing a mapmask to be added simply with the existing Template:Mapframe template, but you are correct that additional flexibility is needed for more complex use cases. -- Ryan (talk) 16:03, 18 November 2016 (UTC)Reply
Ryan, that's not bad for the first attempt - Lua can be painful at times :) I would highly advise to use the simple approach first: a template with this code (I used Q60 to test, but you can remove that)
{{#tag:maplink|
{
  "type": "ExternalData",
  "service": "geomask",
  "ids": "{{{1|Q60}}}"
}
|text=""|group={{{group|mask}}}|class=no-icon}}

--Yurik (talk) 23:55, 18 November 2016 (UTC)Reply

Thanks for the above code - it has been implemented via {{mapshape}} (more exactly {{Mapshape/Inner}}) and appears to be working well. One question though - on the maps with a mask, clicking on the "layers" icon shows a layer named "Group: {"type":"ExternalData","service":"geomas..." I searched to see if there was a parameter I could use to change that label to "mask" (or something similar), but since the "group" param doesn't seem to do it I wasn't sure what to use. If you can provide any advice it would be much appreciated. Thanks! -- Ryan (talk) 00:13, 1 December 2016 (UTC)Reply
Ryan, thanks, I will investigate the group naming thing. About the template - why do you need to have the inner template? I think it over-complicates things without much benefit - you now need to copy multiple templates if you want to have it in another wiki, maintain it in two spots, harder to debug, etc. I might be missing something though :) --Yurik (talk) 05:01, 1 December 2016 (UTC)Reply
Thanks! Regarding the wrapped template, it was a suggestion from User:Andyrom75 to work around the issue of not being able to pass in the Wikidata ID for the current page as a default - see User talk:Wrh2#Thanks. If you have another suggested workaround let me know. -- Ryan (talk) 06:53, 1 December 2016 (UTC)Reply