Topic on User talk:Yurik

Mikey641 (talkcontribs)

Hey. Is there a way to use this SPARQL in Kartographer?

#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?coords {
   	VALUES ?itemclass { wd:Q5710433 wd:Q132821 }
    ?item wdt:P31/wdt:P279* ?itemclass  .
    wd:Q1218 wdt:P625 ?jerusalemloc .

    SERVICE wikibase:around {
      ?item wdt:P625 ?coords .
      bd:serviceParam wikibase:center ?jerusalemloc . 
      bd:serviceParam wikibase:radius "250" . 
    } 

  SERVICE wikibase:label {  
    bd:serviceParam wikibase:language "he" .  
  }   
}

Try it!

Thanks

Yurik (talkcontribs)

@Mikey641, you can use SPARQL in Kartographer to get shapes (polygons) and lines , but you cannot use coordinates at this point. See help page.

Mikey641 (talkcontribs)

Oh. That's too bad. Well, is there any way to convert JSON to the wikimedia GeoJSON?

Yurik (talkcontribs)

@Mikey641, what do you mean by JSON? Also, "Wikimedia GeoJSON" is not different from the standard GeoJSON, just has an optional extra type called "ExternalData", but otherwise it is standard.

Mikey641 (talkcontribs)

by JSON I mean that when you run the query you get a button to download the data to a couple of formats: JSON, TSV and CSV or SVG. My question is if there is a tool to convert it to GeoJSON.

When I converted this query to GeoJSON it didn't work in wikipedia. Look at this edit

Yurik (talkcontribs)

@Mikey641, those downloads only work inside the wikidata query service. With <mapframe>, you need to specify a query inside the "ExternalData" type, with service="geoshape". Mapframe/maplink will draw the shapes (polygons or lines) if the objects in OSM have wikidata tags with the same value as the "id" column:

<mapframe>
{
  "type": "ExternalData",
  "service": "geoshape",
  "query": "
SELECT ?id ?title ?description ...
Reply to "Kartographer"