Help talk:Extension:Kartographer

Jump to navigation Jump to search

About this board

Welcome to the Maps discussion. This is a place to provide overall maps feedback.

Previous discussion was archived at Help talk:Extension:Kartographer/Archive 0 and Help talk:Extension:Kartographer/Archive 1.

Using on my own Mediawiki installation

7
Odoxo (talkcontribs)

Is it possible to use the Kartographer extension on my own mediawiki site? I can install the extension but can't see anywhere to input an API key?

Jackmcbarn (talkcontribs)

An API key for what?

Odoxo (talkcontribs)

The majority of tiles don't load when i'm exploring the map on my own Wiki - Failed to load resource: the server responded with a status of 429 () - presumed this was OSM requiring an API key to authenticate requests but it could be a different configuration error on my side?

TheDJ (talkcontribs)

No, Wikimedia does not provide free or paid hosting for your tiles. Clients from domains other than WMF domains are severely rate limited. Unfortunately this was required, due to some ppl making excessive use of the WMF tiles.

You can configure another tile server using the wgKartographerMapServer configuration variable.

Odoxo (talkcontribs)

Ok that makes sense, i'm struggling to find how to configure the tile server using the current documentation. You'll have to forgive my obvious questions as i'm still fairly new to Mediwiki administration. Is it therefore just a case of adding $wgKartographerMapServer = 'a_new_tileserver'; to the localsettings.php file?

TheDJ (talkcontribs)

Correct:

A standard WMF tile has the format https://maps.wikimedia.org/osm-intl/4/5/3@2x.png

With the following mapping:

  • $wgKartographerMapServer = 'https://maps.wikimedia.org'
  • $wgKartographerDfltStyle = 'osm-intl'
  • $wgKartographerStyles = an array of all available variants of a map: ["osm-intl", "osm"]

It should be noted that Kartographer map service also provides geoshapes etc, which most other services cannot provide btw.

Odoxo (talkcontribs)

Thanks for this, i'm starting to get my head around how it works and have been able to get a map to display using your advice. Currently I've set two tags

$wgKartographerMapServer = 'https://tile.thunderforest.com';

$wgKartographerDfltStyle = 'landscape';

Which is now displaying the map but with an 'API Key required' watermark. I've signed up for a free key at thunderforest but now need to inject this into the URL path at the end (e.g https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=<insert-your-apikey-here>) . Is there another mapping command to do this?

Reply to "Using on my own Mediawiki installation"

Can't make marker display

4
Summary by TheDJ

coordinate specification was incorrect

HLHJ (talkcontribs)

At Wikipedia:Ōnawe Peninsula, I can't display a marker, even if I directly copy the Exploratorium example and just edit its co-ordinates. AM I just doing something foolish? I'm trying to follow the directions. HLHJ (talk) 19:05, 7 March 2020 (UTC)

Matroc (talkcontribs)

I corrected it for you -- the marker did appear but somewhere near the top of the map.

Coordinates section should be "long,lat" and not "lat,long" --- ie. "coordinates": [ 172.9293, -43.7909] },

I also add a # sign on the hex color for the marker - "marker-color": "#0050d0" -- Not sure if that matters here as I work on a different wiki.

Hope that helps - Cheers! ~~~~

HLHJ (talkcontribs)

A belated thank you, @Matroc. I really had done something foolish! HLHJ (talk) 14:37, 2 August 2020 (UTC)

Matroc (talkcontribs)

@HLHJ You are welcome! Just a minor thing - you would be surprised how many people put coordinates as lat,long - not foolish - all the best!

Reply to "Can't make marker display"

Announcing ‘Map Improvements 2018’

2
JMatazzoni (WMF) (talkcontribs)

Over the next four months, the WMF Collaboration team will be making improvements to mapping software (Kartographer) and related functions. The team’s engagement with maps was prompted in part by the overwhelming support the maps community gave the 2017 Community Wishlist proposal for Kartographer Improvements. The project, which we’re calling Map Improvements 2018,  is currently in its very early research and planning stages. It has a limited term and is scheduled to conclude at the end of June.

The immediate goals of the Map Improvements project are:

  • To ensure that Kartographer and the associated maps technology stack are stable and can be easily maintained as maps gain a wider audience.
  • To accomplish the two “main wishes” named in the Community Wishlist proposal, along with as many of the other wishes as are possible in the time provided. The main wishes are  T112948, “All map location names should be shown in the user's language” (an extremely challenging but crucial job), and T180907, “Add zoom level 19.”

Goals that relate to extending maps to a wider audience—such as bringing mapframe functionality to English Wikipedia (as requested by RfC) and making sure that mapframe works properly on wikis that use Flagged Revisions—are also under serious consideration.

Please visit the project page on MediaWiki.org to learn more and share your ideas and questions.

Naveenpf (talkcontribs)

👍

Reply to "Announcing ‘Map Improvements 2018’"
Ederporto (talkcontribs)

Hello, everybody,

I'm trying to discover what is going on with mapframe maps on this article: Lista de governadores das unidades federativas do Brasil (2015–2019). It's blank, no matter what I try to do to solve. The query is correct, it returns the right amount of items (27 states). Some time ago one person changed the P31 of all states of Brasil on Wikidata, but it was reverted to the original P31, I'm not sure if has influence or not. Can anyone give me some light on that? Thanks!

Matroc (talkcontribs)

I don't do queries but I would hazard a guess that you are not getting the OpenStreetMap coordinates to create the shapes... I am sure someone will provide an answer - best wishes - ~~~~

197.218.88.81 (talkcontribs)

This is because there is an error with the query, two governors from the same place, Alagoas, Q40885. Even before that the query wasn't correct, it contained a newline before the "select". There might be other errors.

MSantos (WMF) (talkcontribs)
Daylen (talkcontribs)

Is it possible to enable the maps to show country borders, regardless of the zoom level? Thank you.

Reply to "Country border lines"

Displaying maps from commons with wikidata query

2
Nikola Tulechki (talkcontribs)

Hello, my question is very similar to that of @Yair rand below.

I am looking for a way to display multiple maps stored in Commons using a Wikidata query. The polygons I want do not exist as OSM relations. I am looking for a way to fetch them directly from Commons, but select and and style them using a WD query

Is that possible?

Thanks

NT

TheDJ (talkcontribs)
Reply to "Displaying maps from commons with wikidata query"
Fokebox (talkcontribs)

Hello,

Is it possible to insert any text inside of the symbol or not?

Matroc (talkcontribs)

Not that I know of... A-Z, 1-99 and maki symbols (and blank) are what I use. -- ~~~~


Colorado highlighted map shows Atlantic Ocean

5
Summary by TheDJ

Related to bug phab:T225350

Mathglot (talkcontribs)

The link labeled, "Result: State of Colorado, highlighted" instead shows a patch of the Atlantic Ocean west of Gabon. [[Help:Extension:Kartographer#/maplink/6]] gives this link. Mathglot (talk) 22:11, 10 February 2020 (UTC)

Arlo Barnes (talkcontribs)
Mathglot (talkcontribs)

@Arlo Barnes: Yes, I'm curious and interested, and thanks very much for posting that! Mathglot (talk) 06:27, 12 February 2020 (UTC)

Matroc (talkcontribs)

I fixed this by adding latitude and longitude paremters

TheDJ (talkcontribs)

This was a bug with autozoom/positioning, which is now fixed.

Commons Geoshapes with SPARQL queries

9
Yair rand (talkcontribs)

(I hope this is an acceptable place to ask questions regarding how to use this extension?)


Is there any way to use specific geoshapes from Commons (using Wikidata's geoshape property) on maps pulled using Wikidata SPARQL queries?

2A02:8109:9B40:78:452:F808:5C06:3550 (talkcontribs)
Yair rand (talkcontribs)

No, those geoshapes are not pulled from Commons via Wikidata. They are pulled from another source (I'm not completely sure which), that has a very limited set of geoshapes available, and does not, for example, include all countries.

Dipsacus fullonum (talkcontribs)

That other source is Open Street Map (OSM) which indeed do have geoshapes for very many things, but you need to put a Wikidata tag to the OSM relations before they can be used by Kartographer. You can log in OSM with your Wikimedia login and edit the map data. They is a brief explanation of how to that at Help:Extension:Kartographer/OSM. But not all relations (geoshapes) at OSM can be used. It depends on their their type. See phab:T156433.

The answer to the original question is no as far as I know.

Yair rand (talkcontribs)

Adding Wikidata tags to OSM relations doesn't seem to work.

See for example, w:User:Yair rand/mapsandbox2. This is a very simple, one-line query showing all UN member states. However, despite the Wikidata item for Russia linking to the correct OSM relation, which links back to the Wikidata item, the boundaries for Russia still don't work (along with the boundaries for China, Brazil, Argentina, and many others).

Dipsacus fullonum (talkcontribs)

The boundaries for these countries works when I look at your mapsandbox2.

Yair rand (talkcontribs)

That's really confusing. I just tried it on multiple browsers on multiple computers, and couldn't get those countries to show up highlighted in the dark grey. Other countries show up highlighted, but certain ones aren't.

Very bizarre.

Dipsacus fullonum (talkcontribs)

Yes, I have also several times experienced some strange behavior from using Kartographer with external OSM data. I just made a new case about it on Phabricator at phab:T224846.

Yair rand (talkcontribs)

That task is marked as fixed, but certain countries still don't show up. May or may not be related to phab:T218097, I'm not sure...

Reply to "Commons Geoshapes with SPARQL queries"

Problem getting some geoshapes via Wikidata ID

8
2A02:8109:9B40:78:452:F808:5C06:3550 (talkcontribs)

Hello,

I can't get the geoshapes from Bosnia and Hercegovina (Q224) and Montenegro (Q236). Does someone know why this does not work?

I use

{"type": "ExternalData",
 "service": "geoshape",
 "ids": "Q224",
 "properties": {
   "title": "BiH",
   "description": "BiH",
   "fill": "#7DF9FF"
 }}

and

 {"type": "ExternalData",
 "service": "geoshape",
 "ids": "Q236",
 "properties": {
   "title": "Montenegro",
   "description": "Montenegro",
   "fill": "#808080"
 }}

.

2A02:8109:9B40:78:452:F808:5C06:3550 (talkcontribs)

Sorry, I mean Q22 for BiH.

2A02:8109:9B40:78:452:F808:5C06:3550 (talkcontribs)

Sorry, Q225.

Matroc (talkcontribs)

Both do not have a link to OSM shape in Wikidata - however you can use the Data files from Commons with the shapes:

Data:Bosnia.map and Data:Montenegro.map

{ "type": "ExternalData", "service": "page", "title": "Montenegro.map"}

and

{ "type": "ExternalData", "service": "page", "title": "Bosnia.map"}


Cheers! -- ~~~~

2A02:8109:9B40:78:E4DF:2B35:F544:FAD5 (talkcontribs)

Thank you! Where do you see this that there is no link? In the article https://www.wikidata.org/wiki/Q236 (montenegro), there is a geoshape attribute and a link to a map file. --~~~~

Dipsacus fullonum (talkcontribs)

There are some misunderstandings here. The code with "type": "ExternalData", "service": "geoshape" do not access the geoshape linked from Q236 at Wikidata with property P:P3896 (geoshape). It will take the geoshape from OpenStreet Map relation 53296 (https://www.openstreetmap.org/relation/53296) because that relation is tagged with wikidata:Q236. But there some problems so it not always works. See phab:T224846.


To access the geoshape file at Commons you should use code like this, that works:


<mapframe text="Montenegro with geoshape from Commons" latitude="42.8" longitude="19.5" zoom="6" width="200" height="200">

{

  "type": "ExternalData",

  "service": "page",

  "title": "Montenegro.map"

}

</mapframe>


See the manual at mw:Help:Extension:Kartographer#Map data from Commons.

Dipsacus fullonum (talkcontribs)

It doesn't matter if Wikidata points to the OSM relation or not. What matters is that the OSM relations must point to the Wikidata items, and relations do that (https://www.openstreetmap.org/relation/2528142 for Bosnia and Hercegovina, and https://www.openstreetmap.org/relation/53296 for Montenegro). It works for other countries, for instance Croatia (Q224 which is in the example above by mistake, realation https://www.openstreetmap.org/relation/214885)

One difference between the OSM relations for Bosnia and Hercegovina, Montenegro, and Croatia is that the first two have a point for label, while the Croatia relation doesn't have a label point. I don't know but the label point could be a reason it doesn't work with Bosnia and Hercegovina and Montenegro.

Matroc (talkcontribs)

Thanks... I forgot to mention about OSM relation pointing to Wikidata - I was under the impression that it was a 2 way street (both directions) as well.

Reply to "Problem getting some geoshapes via Wikidata ID"