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]...
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/#...
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 ...
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, ...
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 ...
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)$"]->....
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 ...
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 ...
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 ...
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 ...
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 ...
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,...
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 ...
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:
[...
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 ...
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];
{{...
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)$"];
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 ...
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(...
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 ...
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 ...
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[&...
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 ...
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=*...
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