Page MenuHomePhabricator

Display map for geocoordinate statements
Closed, ResolvedPublic

Description

<maplink> is way more user-friendly than the current link to GeoHack. If it's possible, <mapframe> would be even more nice. The AuthorityControl gadget or Wikibase source code should be adjusted to use this feature or some seperate gadget should be created.


Patch-For-Review:

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Addshore triaged this task as Medium priority.Sep 19 2018, 7:02 AM

Change 472061 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Add SnakFormat to help handling SnakFormatter::FORMAT_* constants

https://gerrit.wikimedia.org/r/472061

Change 472062 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Add SnakFormatter::FORMAT_HTML_VERBOSE_PREVIEW

https://gerrit.wikimedia.org/r/472062

Change 472674 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/WikibaseLexeme@master] Use SnakFormat, prepare for new SnakFormatter formats

https://gerrit.wikimedia.org/r/472674

Using Kartographer on Wikibase Repo is now ready to be reviewed IMO :)

Change 472793 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Kartographer@master] Add mw.kartographer.initMapframeFromElement

https://gerrit.wikimedia.org/r/472793

Change 472794 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] Use mw.kartographer.initMapframeFromElement

https://gerrit.wikimedia.org/r/472794

Change 472061 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add SnakFormat to help handling SnakFormatter::FORMAT_* constants

https://gerrit.wikimedia.org/r/472061

Change 472674 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Use SnakFormat, prepare for new SnakFormatter formats

https://gerrit.wikimedia.org/r/472674

Change 472062 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add SnakFormatter::FORMAT_HTML_VERBOSE_PREVIEW

https://gerrit.wikimedia.org/r/472062

@hoo I will be taking a look on the code as soon as possible. Thanks for working on that.

Change 472793 merged by jenkins-bot:
[mediawiki/extensions/Kartographer@master] kartographer.mapframe: Expose initMapframeFromElement

https://gerrit.wikimedia.org/r/472793

Change 433890 merged by jenkins-bot:
[data-values/value-view@master] valueview: Re-render "globecoordinate" values for preview

https://gerrit.wikimedia.org/r/433890

Change 474665 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] data-values-value-view 0.22.3 -> 0.22.4

https://gerrit.wikimedia.org/r/474665

Change 474665 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] data-values-value-view 0.22.3 -> 0.22.4

https://gerrit.wikimedia.org/r/474665

Change 434177 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Use Kartographer mapframes for displaying maps

https://gerrit.wikimedia.org/r/434177

Change 472794 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Use Kartographer's initMapframeFromElement

https://gerrit.wikimedia.org/r/472794

Change 476143 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/Wikibase@master] CachingKartographerEmbeddingHandler: Fix comment about Kartographer modules

https://gerrit.wikimedia.org/r/476143

Apparently I made a mistake when adding the change list to the task description yesterday, for some reason I thought Wikibase: use Kartographer hadn’t been merged yet.

@hoo is there anything left to review here, other than the “fix comment” change?

For the record, this just went live with the train, so I guess it should’ve been in the “needs announcement” column at some point. But I’ll leave it in “needs review” now for the last unmerged patch. @Lydia_Pintscher, if you want to do the “verification” part already, you can see it in action at https://www.wikidata.org/wiki/Q4115189#P626.

@Lucas_Werkmeister_WMDE This is done for Wikibase repo… but there's still a patch (by @Tpt) pending for the wikitext formatter (for clients). Do we want to create a new bug for that?

Change 476143 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] CachingKartographerEmbeddingHandler: Fix comment about Kartographer modules

https://gerrit.wikimedia.org/r/476143

Lydia_Pintscher renamed this task from Use <maplink> or <mapframe> to view coordinates on Wikidata to Display map for geocoordinate statements.Nov 29 2018, 10:23 AM

Change 476474 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Added feature flag for globe coordinator formatter using kartographer

https://gerrit.wikimedia.org/r/476474

Change 476474 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Added feature flag for globe coordinator formatter using kartographer

https://gerrit.wikimedia.org/r/476474

Change 476489 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@wmf/1.33.0-wmf.6] Added feature flag for globe coordinator formatter using kartographer

https://gerrit.wikimedia.org/r/476489

Change 476489 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@wmf/1.33.0-wmf.6] Added feature flag for globe coordinator formatter using kartographer

https://gerrit.wikimedia.org/r/476489

Mentioned in SAL (#wikimedia-operations) [2018-11-29T13:45:02Z] <hashar@deploy1001> Synchronized php-1.33.0-wmf.6/extensions/Wikibase: feature flag for globe coordinator formatter using kartographer - T184933 T210617 (duration: 01m 18s)

I don’t think so, why? The already merged patches are mostly for displaying coordinates on the repo, whereas the linked chain is for the client, if I understand correctly.

I don’t think so, why? The already merged patches are mostly for displaying coordinates on the repo, whereas the linked chain is for the client, if I understand correctly.

It is… given this bug was originally about WikibaseRepo, I chose to move the other patches to a new task (T210926).

Change 477817 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[operations/mediawiki-config@master] Enable Kartographer maps on testwikidatawiki

https://gerrit.wikimedia.org/r/477817

Change 477817 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable Kartographer maps on testwikidatawiki

https://gerrit.wikimedia.org/r/477817

Mentioned in SAL (#wikimedia-operations) [2018-12-05T17:23:10Z] <hoo@deploy1001> Synchronized wmf-config/Wikibase.php: Enable Kartographer maps on testwikidatawiki (T184933) (duration: 00m 46s)

This can now be seen on testwikidata: https://test.wikidata.org/wiki/Q22#P10 (the newest version of the authority control gadget is also already in place, so that's how it's going to look on Wikidata)

Change 477976 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[operations/mediawiki-config@master] Wikidata: Display Kartographer mapframes for geocoordinate statements

https://gerrit.wikimedia.org/r/477976

I just scheduled a deployment to enable this on Wikidata for December 12 12:00–13:00 UTC.

(CC @Lea_Lacroix_WMDE)

Fancy...
Just a followup/enhancement idea: since we have precision.. wouldn't this be a good place to draw a precision circle ?

Fancy...
Just a followup/enhancement idea: since we have precision.. wouldn't this be a good place to draw a precision circle ?

This is a very good point: Basically we can alter the generated mapframes like in any article… in fact we generate them from wikitext (see CachingKartographerEmbeddingHandler::getWikiText).

I created a new task (T211676) for this… suggestions on how exactly to implement this are very welcome there :)

Fancy...
Just a followup/enhancement idea: since we have precision.. wouldn't this be a good place to draw a precision circle ?

This is a very good point: Basically we can alter the generated mapframes like in any article… in fact we generate them from wikitext (see CachingKartographerEmbeddingHandler::getWikiText).

I created a new task (T211676) for this… suggestions on how exactly to implement this are very welcome there :)

Awesome idea! The only problem is that GeoJSON does not support circles :( I guess it will be a choppy circle, e.g. with 16 sides :)

Change 477976 merged by jenkins-bot:
[operations/mediawiki-config@master] Wikidata: Display Kartographer mapframes for geocoordinate statements

https://gerrit.wikimedia.org/r/477976

Mentioned in SAL (#wikimedia-operations) [2018-12-12T12:03:55Z] <hoo@deploy1001> Synchronized wmf-config/Wikibase.php: Display Kartographer mapframes for geocoordinate statements (T184933) (duration: 00m 52s)

Live, announced, works well \o/

Just for the sake of tracking:

  • users may need to purge the page to see the feature
  • the link on the coordinates appears when the gadget AuthorityControl is enabled

This is very nice! I'm not sure if I should raise these points here or in a new bug, but I have three suggestions (based on deploying kartographer on Commons):

<s>1) The map should only be shown for cases where the coordinate globe is Q2 (Earth) - for example, it does not make sense to show it at Q520 (Olympus Mons, on Mars).</s> - sorry, this is already done, I was confusing it with something else in those cases.

  1. It would be great if the area was highlighted using the OSM links - for example, see the maps at: https://commons.wikimedia.org/wiki/Category:São_Paulo and https://commons.wikimedia.org/wiki/Category:Buckingham_Palace
  1. It might be worth setting the default zoom level based on the area property, where available, which is done on Commons using https://commons.wikimedia.org/wiki/Template:AutoMapZoom

@hoo Another question was also raised: is it possible to adapt the scale of the map (=zoom level) depending on what it is about?
(see discussion here)

@hoo Another question was also raised: is it possible to adapt the scale of the map (=zoom level) depending on what it is about?
(see discussion here)

I looked at this briefly and it would be hard to integrate with how the maps are currently generated. Also on commons units are not currently respected when evaluating this… that's something we would need to get right.

We could adapt the zoom based on precision, though (see T211676).

It would be great if the area was highlighted using the OSM links - for example, see the maps at: https://commons.wikimedia.org/wiki/Category:São_Paulo and https://commons.wikimedia.org/wiki/Category:Buckingham_Palace

That indeed looks very nice :) But I don't think we can link one coordinate to a certain geoshape in Wikibase right now… this could surely be done, but even the how needs more thought (through a qualifier? Through a statement on the property?). Doable, but definitely needs quite a bit of work.

@hoo Another question was also raised: is it possible to adapt the scale of the map (=zoom level) depending on what it is about?
(see discussion here)

I looked at this briefly and it would be hard to integrate with how the maps are currently generated. Also on commons units are not currently respected when evaluating this… that's something we would need to get right.

We could adapt the zoom based on precision, though (see T211676).

Yup - what's on Commons isn't ideal, but it seems to work in most cases. I'd be happy to test out improvements to this on Commons, if that would help.

It would be great if the area was highlighted using the OSM links - for example, see the maps at: https://commons.wikimedia.org/wiki/Category:São_Paulo and https://commons.wikimedia.org/wiki/Category:Buckingham_Palace

That indeed looks very nice :) But I don't think we can link one coordinate to a certain geoshape in Wikibase right now… this could surely be done, but even the how needs more thought (through a qualifier? Through a statement on the property?). Doable, but definitely needs quite a bit of work.

The code/settings used on Commons is in https://commons.wikimedia.org/wiki/Template:Mapframe/Wikidata:

{"type": "ExternalData", "service": "geoshape", "ids": "{{GetQID|qid={{{qid|}}}}}", "properties": { "fill": "{{{background_color|#999999}}}", "stroke": "#{{{stroke_color|636363}}}", "stroke-width": {{{stroke_width|2}}} } }

The data is stored on OSM rather than Wikibase, it just uses the QID to look it up. Again, it seems to work quite well (where it's available).