How to use overpass-turbo to find nearby items (nodes, ways) for a given input:csv?

Hi - I’m new to this forum and new to overpass-turbo.
I see an option to export data with out:csv.
I want to input some given locations (geopos) from a csv list and for each let overpass-turbo find OSM items of certain type nearby (within range) of the given position.
Thanks for any help. (English and German is fine.) Martin

Hi Martin-osm.

I think that the only way is to code these locations directly in Overpass QL statements.
A basic query to find, for example, buildings of type apartments within a 50 meters radius from every single location would be like this one:


[out:json][timeout:25];
(
   way[building=apartments](around:50,<lat1>,<lon1>);
   way[building=apartments](around:50,<lat2>,<lon2>);
   // and so on for any other lat,lon
);
(._;>;);
out;
2 Likes

Thanks for reply !
Well, so there is no real “get your input data from here ” ; use it as var x to loop the next statements.
So no real batch processing in the overpass turbo syntax?
So, I understand I have to include all my data input in the statements directly: with 1000 data points I need to add 1000 lines. :man_shrugging:t3:
Anyone else any idea?

So, I understand I have to include all my data input in the statements directly: with 1000 data points I need to add 1000 lines. :man_shrugging:t3:
Anyone else any idea?

with 1000 data points you can call your script a 1000 times. Seems more reasonable, as all these queries appear to be independent from each other. If something goes wrong, you can continue from there without repeating all the successful queries…

not sure what you mean with “your script”?
I just use the web interface overpass-turbo. I don’t know a script statement in that interface.
In the API I see the special clauses around: and poly:
with poly: I can not just focus at one geoposition (point) at a time - I need to specify at least three points for a poly
with around: I have to specify a distance value. But I can not specify one geopostion (point) as a reference position.
I’m looking for some kind of special clause point: or position: where to specify a certain location or several locations as a reference point.
These locations I want to inspect are not defined in OSM but these come from some external file/database. I want to use these as input for my overpass-turbo query. (Instead of manuall marking a bbox I want to input these from a file.)

Perhaps there is no support for this in overpass yet ?
Wouldn’t that we useful (for kind of batch processing)? Where to propose such request?
Thanks.

Searching for something at a certain radius from other features can only be obtained with the around filter.
Using it in the simplest form with only a distance value needs an input set with data to be used as “points” to search around, and that’s not your case since, as you noted, you have arbitrary “reference points” not represented by OSM elements.
The syntax I suggested in my previous post allows to search around your “reference position” points. Did you try for example with only one point of yours ?

Thanks again for reply!
I missed to look at the extended syntax which allows to add a number of <lat*>,<lon*> reference points. I must have looked at an outdated documentation about the around: feature.
Ok, this new features helps!
Yes, I can insert such list of reference points in the code. Fine ! Thanks for the advice !
Still it would be handy to refer to some external source (url) to load the data list from. For now I have a working solution. Thanks!

Please note that adding in a single around statement more that 1 pair of coordinates will search elements along the path that connects those points, and not only inside the specified radius from each of them.

1 Like

Oh - thanks for this important notice!
Actually a nice feature - but I did not expect that.
Perhaps I need to look at the loop constructs like for or complete …
overpass-turbo is a great tool anyway !