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 ...
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://...
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. ...
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.
...
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;
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"...
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 ...
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 ...
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 ...
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 ...
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 (...
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;
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(...
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 ...
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/...
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 ...
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. ...
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 ...
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 ...
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': &...
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]...
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;
""")
...
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.
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 ...
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.
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.
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
(
// ...
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 ...
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)[&...
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, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
overpass-api × 377openstreetmap × 254
overpass-turbo × 84
python × 35
query × 22
qgis × 19
geojson × 15
nominatim × 14
quickosm × 10
api × 9
postgis × 7
polygon × 7
extents × 7
leaflet × 6
export × 6
osm2pgsql × 6
osmosis × 6
osmnx × 5
postgresql × 4
intersection × 4
java × 4
area × 4
filter × 4
xml × 4
josm × 4