Jump to content

Topic on Help talk:Extension:Kartographer/Archive 2

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"