Open plepe opened 5 years ago
My respone on 2019-02-18:
Hmm, interesting. Do you mean as a special category which shows e.g. all address nodes which belong to a street or more a general selection which applies to all categories? I could image a button (or so) which restricts the query to all objects within an (adminstrative) boundary, a custom bounding box or - as you suggested - close to a node / way (e.g. street).
No, I did not mean a special category to show all address nodes that belong to some way. What I'm looking for is to filter any items defined by an existing category or query (in my case, hotels) further by their distance to a particular way being under a limit (in my case, let's say, 2 or 5 km).
In my real case I want to plan a 3-day tour on a bicycle path being about 250 km long. What I want to find are land hotels in beautiful areas outside larger cities, but near that path.
Limiting hotels found to within some administrative bounday or bounding box is not helpful here, because that would return way too much hits inside larger cities. When zooming in to restrict the number of hits to those next to that bicycle path causes a loss of general overview and is tedious.
Because I'm a software developer, I would be perfectly happy with some very complicated search syntax to be entered into the definition of my self-defined category: I do not need any user interface (button or so).
I see. I think this is a very useful feature and I would love to implement this in OpenStreetBrowser, but I'm sure this won't happen anytime soon.
But there's help :-)
You can use Overpass Turbo to achieve this. Use this query:
[out:json];
relation(6562780); // replace this by the ID of your bicycle route relation
out geom; // remove this to hide the relation
nwr(around:200)[amenity=restaurant]; // 200 is the max distance in meters, replace `amenity=restaurant` by `tourism=hotel` or `tourism~"^(hotel|hostel|motel)$"`.
out geom;
More info on this query language: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL
I hope I could help :-)
And, did you achieve what you wanted?
Juergeen wrote on 2019-02-17 in the OSM Wiki:
Is it possible to filter the nodes found by their distance to some specific way, for instance to show alle the hotels next to or near a road ? Not fltering on a low zoom level that shows a long road overloads my browser, and, probably, also the server. The distance should be defined as the distance from each node to the closest point of the way. Because this is not easy to calculate, we might relax this definition to the distance to the closest endpoint of any path that is part of the way: This seems easier to calculate and doesn't make a difference on a low zoom level.