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
4 votes
Accepted

Calculate distance between location and way segment

In such cases the best strategy is to use existing solution/library, and in this case that would be turf.js library and it's method turf.nearestPointOnLine (see https://turfjs.org/docs/#...
TomazicM's user avatar
  • 21.4k
4 votes
Accepted

Problems getting information on ways that are returned from an Overpass query with Overpy

If you have a look at the overpass documentation, the out body on a set of ways just gives the IDs and tags of the ways, and the IDs of the nodes in the ways. But no geographical indication. To get ...
XaC's user avatar
  • 372
3 votes
Accepted

Exclude (filter) relation members by type or role

Filtering relation members by object type is currently not supported. However, you could suppress the location information for the node members, while still retaining the overall relation. This way, ...
mmd's user avatar
  • 4,324
3 votes

Overpy or Overpass Turbo: How to get nodes by their IDs

I didn't get any answers or hints, nor could I find any examples of doing this (except in Overpass API, which has a slightly different syntax), but by trial and error I discovered the answer (which is ...
Aaron Bramson's user avatar
3 votes

Overpass API: Find nearest intersection to lat/lng

You can try something like this : node(around:80,-2.9027958824455133, -79.02495784310128)->.aroundnodes; way(bn.aroundnodes)[highway~"^(residential|primary|secondary|tertiary)$"]->....
Alex Samaniego's user avatar
2 votes
Accepted

QuickOSM does not return results

You must use the full name of the street: Bäckerstraße, as the street is tagged in OSM, instead of bäckerstr. To look for bäckerstr, you must perform a search query that 1) truncates and 2) ignores ...
Babel's user avatar
  • 60.2k
2 votes

How can I hide objects in output in Overpass Turbo?

Your query is doing an union of: elements with the relation linked to the postal code nodes with ["power"="generator"]["generator:method"="photovoltaic"] ways ...
XaC's user avatar
  • 372
2 votes
Accepted

Find intersection between highways and GeoJSON polygon

I found the way to do this in case anyone might want to do something similar. I used shapely package to work with geojson data. Find the bounding box: Since I wanted to work with the data inside my ...
Fateme Fouladkar's user avatar
2 votes
Accepted

Why do certain features from Geofabrik's OSM extract seem to be missing?

man_made is an important tag that has its own field, so you can query it directly: ogr2ogr -f GeoJSON factories_${each}.geojson estonia-latest.osm $each -where "man_made='works'" The fields ...
JGH's user avatar
  • 38.3k
2 votes

Retrieve map matched ways (and not just nodes) using OSRM and Overpass API

tl;dr: You can't, feasibly, and you shouldn't, really. But: If all you want is OSM way ids of ways that have been traversed at least partially, cross reference your list of input nodes (those sent to ...
geozelot's user avatar
  • 27.9k
1 vote
Accepted

Overpass API query to retrieve way ids given a list of node ids

That's actually fairly easy to do: node(id:384845483,3831831361,2628299968,502266756,346268605,373873712,1302513709,9444444740,2431858827,10287564212,271979126,10721097610,10287564276,10721097609,...
mmd's user avatar
  • 4,324
1 vote

Finding the nearest named highway way id

Even though I have received a great reply by @mmd, I would like to submit my own answer to help the future users trying to find the nearest way to a location. For that I have prepared a jsFiddle demo ...
Alexander Farber's user avatar
1 vote
Accepted

Overpass turbo, Get center of area

"Areas" is an Overpass API internal artifact, which is not suitable to calculate a center point for. Instead you want to determine the center using out center; for both ways and relations: [...
mmd's user avatar
  • 4,324
1 vote
Accepted

Retrieve relations using specific coordinates in an overpass query

Check for the correct order of your coordinates. The correct order for the Overpass bbox is south,west,north,east, i..e, latitude of the southern edge, longitude of the western edge, latitude of the ...
scai's user avatar
  • 5,914
1 vote
Accepted

Wildcard in QuickOSM name tag

The solution turned out to be relatively simple: it's sufficient to replace the = with a ~. This apparently looks for partial matches. Using the original example: [out:xml] [timeout:25]; {{...
dk2ax's user avatar
  • 183
1 vote
Accepted

Overpass QL for multiple values without union?

A value match by regular expression can be used to achieve this without multiple statements in a union: rel({{bbox}})[route~"^(road|bicycle)$"];
mmd's user avatar
  • 4,324
1 vote
Accepted

Iteratively passing variables containing polygons to Overpass API to count buildings

Your example of polygon string is in the middle of the Indian Ocean, so there might not be that many buildings there... Overpass documentation on polygons: (poly:"latitude_1 longitude_1 ...
XaC's user avatar
  • 372
1 vote
Accepted

Recursively Querying Ways/Nodes Within a Building

I'd suggest the following approach where we first identify all member ways of the relation, and then check all amenity=toilets in any of the closed ways therein. rel[wikidata=Q835662]; way(r); nwr(...
mmd's user avatar
  • 4,324
1 vote
Accepted

How to query low level of hiking road?

Overpass API doesn't support simplifying geometry, it would return the query data as they can be found in the original OpenStreetMap data. You could however try to use out geom instead, which reduces ...
mmd's user avatar
  • 4,324
1 vote

OpenStreetMap - Overpass API; geometry disappears from node when using center

You could use two separate output commands: [out:json][timeout:25]; ( way["building"]({{bbox}}); relation["building"]({{bbox}}); ); out geom; out center ids; // use ids to ...
Bjorn Svensson's user avatar
1 vote

overpass-turbo Export CSV of all adresses

In overpass-turbo, you can use something like this that creates a CSV: [out:csv('addr:city','addr:housenumber','addr:postcode','addr:state','addr:street',building;true;',')] [timeout:25]; ( nwr[&...
Bjorn Svensson's user avatar
1 vote

How do I search all primary, secondary, and tertiary street intersections via Overpass?

OpenStreetMap doesn’t explicitly tag intersections per se, but it does have tags representing traffic control at intersections, namely highway=traffic_signals, highway=stop, highway=give_way, and ...
Minh Nguyễn's user avatar
1 vote

Getting Bike Lanes using Overpass Turbo

I would suggest using relation in place of way. It seems to replicate opencyclemap but best to check and modify as required. [out:json][timeout:25]; // gather results ( // query part for: “cycleway=*...
Cushen's user avatar
  • 2,798

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