Hello, WE have a nominatim database setup on AWS with all the streets in the planet. We are trying to find all shops, museums etc on major streets, for example Oxford Street (London). Does anyone know how this is possible using sql? Which tables i.e placex and others we should run a query on and how we can run joins? asked 10 Sep '13, 16:08 mezbaur |
The main problem is indeed to define what is a major road and what is the POI you are looking for. If you can define that in terms of an OSM tag then you can do a simple self-join on For example, lets say you want all shops close to a
If you want to search for all major roads as defined in Nominatim's details view you can also search by rank:
This will even be faster because there is an index over rank_search. (The highway constraint is still necessary so you don't end up with things like airports which are also in this rank.) answered 12 Sep '13, 19:17 lonvia |
Hi, then tell us first how a computer or a database should know what street is a major street, and which is not. The general classification on street types are defined at http://wiki.openstreetmap.org/wiki/Key:highway ... but does this help?
Or do you have a manual selection of streets that are in your focus?
We want to search on primary streets http://wiki.openstreetmap.org/wiki/Tag:highway%3Dprimary for example Oxford Street and bring back all shops on that street.
next question:
How do you define whether a POI belongs to a primary street or not? Is it enough do determine them via addr-tags? in many aread addr-tags are not complete in OSM data.
Or do you aim at a certain distance? is it then 30 meters or 50 meters or 100 meters from the center of the street line?
So before thinking about a concrete SQL query, be aware how you will find your objects in a logical way. Are you really familiar with the OSM data elements, and how they interact to each other and how not?
Thanks for making asking some valid questions. I am a newbie on OSM and Nominatim.