19 votes

Understanding OverpassTurbo query?

overpass turbo wizard uses a template based approach to create an Overpass QL query. This way you can easily get started with Overpass API without having to deal with all the details. For many use ...
mmd's user avatar
  • 4,324
17 votes
Accepted

Get a JSON return from a Overpass API call

You can't get a JSON result from the XAPI-compatibility endpoint. Instead, use the standard Overpass API (“interpreter”) endpoint and put the [out:json]; at the very start of your ql query: https://...
tyr's user avatar
  • 343
11 votes

Is it possible to get OSM data in geojson via overpass api using ipython?

Overpass API doesn't support GeoJSON. You have to perform the conversion from JSON to GeoJSON yourself. For converting JSON into GeoJSON see this answer. It even contains a solution in Python. ...
scai's user avatar
  • 5,914
11 votes

Saving Overpass query results to GeoJSON file with Python

You could do this using overpass that already returns a geojson object and then, if you want, you can use the geojson package to convert this object into str (string object) or save it in a file. ...
carpinchosaurio's user avatar
10 votes

Using Overpass Turbo to return all peaks over certain elevation

I was able to get it to work with this code: ( node[natural=peak]({{bbox}}) (if:t["ele"] > 4269.2); ); out;
Patrick McGranaghan's user avatar
9 votes
Accepted

Overpass Turbo Area Code Lookup

When searching for country areas instead of using {{geocodeArea:CH}} I found that this also works: area["ISO3166-1"="CH"] To retrieve a list of IDs of country areas you can query ( area["ISO3166-1"...
chrki's user avatar
  • 2,615
9 votes
Accepted

How to download all OSM data within a boundingbox with Overpass?

See the Overpass API Language Guide. Basically you seem to want all data in a bounding box. Depending on your use-case you might want to download nodes, ways and relations. overpass turbo already has ...
scai's user avatar
  • 5,914
9 votes
Accepted

Finding residential buildings with overpass-turbo?

Not all buildings have a corresponding typology tag. Many are just tagged with building=yes (currently 81% of all buildings). Some might have an additional building:use=residential tag. Remember that ...
scai's user avatar
  • 5,914
9 votes
Accepted

Query for WAY that connects two INTERSECTIONS

The following description assumes that you have a list of GPS positions, as well as the OSRM map matching service and Overpass API available. (1) Use OSRM Map Matching service to identify nearest ...
mmd's user avatar
  • 4,324
8 votes
Accepted

Getting list of all embassies using Overpass API?

It's because you are expecting that embassy tags are set on a relation. Looking at TagInfo for amenity=embassy, you will see that nearly no relations were set with this key/value combination. It's in ...
ThomasG77's user avatar
  • 29.8k
8 votes
Accepted

Overpass API Boolean Filtering?

We can formulate the answer in different ways: Option 1: Basically, you want to remove those amenity=embassy from your current result list, which have a diplomatic value that is not embassy (...
mmd's user avatar
  • 4,324
7 votes
Accepted

get center coordinates of a buiding(way)

The following Overpass API Query will return the center of your building: [out:json]; way(292833530); out center meta;
mmd's user avatar
  • 4,324
7 votes

How to use union in area queries (QL/XML) with Overpass API/OpenStreetMaps?

This can be easily fixed by storing the area in a named inputset (I use .a below) and referring to this inputset for both node statements: [out:json]; area[name = "New York"]->.a; ( node(...
mmd's user avatar
  • 4,324
7 votes

Extracting admin boundary data from OpenStreetMap

If it's for specific cities and regions, you can use Overpass Turbo to create queries like admin_level=6 to find border ways. You'll want to consult the Tag:boundary=administrative wiki page to make ...
JoshC's user avatar
  • 3,770
6 votes
Accepted

How can I query for a list of specific road types in the same Overpass query?

[timeout:25][bbox:{{bbox}}]; ( way["highway"="motorway"]; way["highway"="trunk"]; way["highway"="primary"]; ); out body; >; out skel qt; See it on overpass-turbo: http://overpass-turbo.eu/s/...
dmitry.v.kiselev's user avatar
6 votes
Accepted

How to get all rivers from OSM using Overpass?

You might find it useful to go to OpenStreetmap and zoom to your area of interest, then use the query tool (the Question Mark icon). You don't need to be logged in to use this. Next, click on or near ...
Steven Kay's user avatar
  • 20.2k
6 votes

Difference between Nominatim and Overpass-Api?

Nominatim is a geocoder and reverse-geocoder. You can search for an address and it will return the location. Likewise you can search for a location and it will return its full address hierarchy. ...
scai's user avatar
  • 5,914
6 votes
Accepted

Missing/inconsistent River Thames map data in Overpass Turbo

The river Thames is too large to digitize it in one single Openstreetmap way element. Therefore, a relation is created to group all riverbanks belonging to it. You can query that relation directly ...
AndreJ's user avatar
  • 76.1k
6 votes
Accepted

Using Overpass Turbo to return all peaks over certain elevation

Overpass turbo wizard doesn't yet support numerical comparison. However, Overpass Api, the engine powering overpass turbo, already covers this feature. This means that you need to provide the query ...
mmd's user avatar
  • 4,324
6 votes
Accepted

Overpass / Overpy: Getting Way IDs from Nodes

A little more digging found me the answer. Executing e.g. vars(result.get_way(4755884)) gives the internal structure of the way object: {'_attribute_modifiers': {'changeset': int, 'timestamp': &...
Matti Wens's user avatar
6 votes
Accepted

Finding the nearest named highway way id

Overpass API doesn't support a "nearest neighbor"-like query at the moment. While I don't really understand your workaround, you can certainly limit the output to a max of 1 entry: [out:json]...
mmd's user avatar
  • 4,324
5 votes
Accepted

What is a convenient way to write OSM data to a .shp file in python

If I use the first example of overpy import overpy api = overpy.Overpass() # fetch all ways and nodes result = api.query(""" way(50.746,7.154,50.748,7.157) ["highway"]; (._;>;); out body; """) ...
gene's user avatar
  • 53.8k
5 votes
Accepted

OSM download with overpass fails "Network request time out"

The extent (and the data volume) is definitely too big. Alternatively, use QuickOSM to filter the items you want, or Geofabrik daily extracts.
AndreJ's user avatar
  • 76.1k
5 votes

OSM: Getting the correct Overpass Turbo query using a keyword (and values)

In overpass turbo, click on "Wizard", enter tourism=* in the search field and then click on "build and run query" to execute your query. You may of course navigate to your area of interest and hit ...
mmd's user avatar
  • 4,324
5 votes
Accepted

Is there a Service to get only nodes from OSM?

With Overpass API use out center;. See the documentation about Geometry attribute and Print (out) for more information.
scai's user avatar
  • 5,914
5 votes

Comma separated list of valid amenity values

You can also take a look at the most popular amenity values at taginfo. This list is available via JSON. Moreover taginfo offers downloads for all databases.
scai's user avatar
  • 5,914
5 votes
Accepted

Finding all airports in given country or region using Overpass API?

The best starting point for overpass queries is the Openstreetmap wiki, follow the overpass-turbo link on the left. It generates the following query: [out:json][timeout:25]; // gather results ( // ...
AndreJ's user avatar
  • 76.1k
5 votes
Accepted

Query Overpass Turbo for postal code boundaries

You can only get out of Openstreetmap what others have put into the database. If you look at https://taginfo.openstreetmap.org/tags/boundary=postal_code#map, you will see that boundaries of type ...
AndreJ's user avatar
  • 76.1k
5 votes

Listing churches with their administrative location using Overpass

Similar to an example in the Overpass by Example library, I'd suggest to use the following query: [timeout:60]; area["name"="Mayenne"]->.boundaryarea; way(area.boundaryarea)[&...
mmd's user avatar
  • 4,324
5 votes

Overpass API query error: query ran out of memory

By default Overpass API has a certain memory limit in place, to control the overall memory consumption of queries. However, you can easily override that default by providing the maxsize parameter, ...
mmd's user avatar
  • 4,324

Only top scored, non community-wiki answers of a minimum length are eligible