Hi, I'm looking for the most performant Overpass QL query to search for:
I tried (Country "de", location "Zugspitze"):
I noticed:
E.g. I tried to limit the results like this (to places and naturals):
My very simple use case: I want to give the user the possibility to search for a location and limit the results to certain place/natural types (like cities or mountains). It's a simple location search like we see on many mapping portals - and all of them are way faster than the above. How is this done with Overpass? Or is there a completely different way I'm missing? Thanks! asked 20 Sep '20, 19:15 Lukey78 |
Overpass is a very generic query engine and it emphasizes flexibility over performance. Since everyone is using the same Overpass instance and people have vastly different requirements, optimizing towards one use case would often make a different use case slower. You will get the best performance by importing OSM data into a PostGIS database and preprocessing/ indexing it according to your special use case. answered 20 Sep '20, 20:15 Frederik Ramm ♦ Ok, that makes sense. Thank you. I created a location database with some additional tag info from a database I use for my map server (created with osm2pgsql) like this:
Now I just need to find a way to insert the country_code. I could use the Nominatim API of Overpass to query the ISO3166-1 code for all coordinates with an is_in query based on areas of admin_level=2. Or is there a better way to do that on the SQL/Postgis level?
(22 Sep '20, 20:26)
Lukey78
A standard osm2pgsql load without
should add country codes to your There's a little thing I neglected to say in my initial reply; some POIs that you might be interested in could be mapped as an area, not as a point. You might want to repeat your
(22 Sep '20, 22:16)
Frederik Ramm ♦
That is very helpful, thank you for the fast and comprehensive answer!
(23 Sep '20, 19:37)
Lukey78
|