← Temporal
Work with dates, timelines, and history.
Go BackQuery the world with location-based SPARQL. Work with coordinates, calculate distances, filter by regions, and visualize results on interactive maps using Wikidata's rich geographic data.
Wikidata contains geographic coordinates for millions of entities: cities, landmarks, heritage sites, universities, and more. Geospatial queries let you find places near a point, within a region, or calculate distances between locations.
The Wikidata Query Service provides powerful geospatial features including:
Work with latitude and longitude coordinates. Extract, parse, and use geographic points in queries.
Learn CoordinatesCalculate distances between points. Find entities within a specified radius using geof:distance.
Calculate DistanceQuery entities within rectangular regions. Define areas using corner coordinates.
Use Bounding BoxesQuery by administrative regions, countries, or custom geographic areas.
Explore RegionsDisplay query results on interactive maps. Use Wikidata Query Service's built-in map view.
Create Maps#defaultView:Map
SELECT ?lang ?langLabel ?developer ?developerLabel
?hq ?hqLabel ?coord
WHERE {
?lang wdt:P31 wd:Q9143 ;
wdt:P178 ?developer .
?developer wdt:P159 ?hq .
?hq wdt:P625 ?coord .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
LIMIT 100
#defaultView:Map
SELECT ?museum ?museumLabel ?coord ?dist
WHERE {
# Paris coordinates
BIND("Point(2.3522 48.8566)"^^geo:wktLiteral AS ?parisLoc)
SERVICE wikibase:around {
?museum wdt:P625 ?coord .
bd:serviceParam wikibase:center ?parisLoc .
bd:serviceParam wikibase:radius "50" . # km
bd:serviceParam wikibase:distance ?dist .
}
?museum wdt:P31/wdt:P279* wd:Q207694 . # art museum
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,fr" .
}
}
ORDER BY ?dist
LIMIT 50
#defaultView:Map
SELECT ?station ?stationLabel ?coord ?lineLabel
WHERE {
?station wdt:P31 wd:Q928830 ; # metro station
wdt:P131* wd:Q90 ; # in Paris
wdt:P625 ?coord .
OPTIONAL { ?station wdt:P81 ?line . } # metro line
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,fr" .
}
}
| Property | ID | Description |
|---|---|---|
| coordinate location | wdt:P625 |
Geographic coordinates (WKT point) |
| located in | wdt:P131 |
Administrative territorial entity |
| country | wdt:P17 |
Country where entity is located |
| headquarters location | wdt:P159 |
Location of headquarters |
| location | wdt:P276 |
Location of event or item |
| Service | Purpose |
|---|---|
wikibase:around |
Find entities within a radius of a point |
wikibase:box |
Find entities within a bounding box |
geof:distance |
Calculate distance between two points |
Add #defaultView:Map as the first line of your query to automatically
display results on an interactive map in the Wikidata Query Service. The map will
plot all entities that have coordinate values in the results.
#defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE {
# Your query here - must include ?coord
?item wdt:P625 ?coord .
...
}