Is it possible to use the "around" service as a filter, for example to search for a place name in a country and limit results to those within a given distance of a known point.

For example, limit results of the following search to those within 50km of

"Point(-98.966111 19.310278)"^^geo:wktLiteral

SELECT distinct ?item ?itemLabel ?countryLabel ?geom

    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

  ?item rdfs:label "Santa Catarina"@en ;
   (wdt:P31/wdt:P279*) ?itemType ;
    wdt:P17 ?country .
    ?country rdfs:label "Mexico"@en .

  # human settlement | archaeological site  
  FILTER (?itemType = wd:Q486972 || ?itemType = wd:Q839954) .

  # coordinate location
  OPTIONAL {?item wdt:P625 ?geom . }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.