Hello, I am looking for a way to search businesses within a circle (or a polygon) around a GPS coord. It will be nice if I am able to additionally filter results by passing in a parameter such as "coffee" or "school". I looked around, but could not find exactly what I wanted. I have looked at the wiki page for Nominatim, various other forums etc. Here are couple of searches i tried which gave me only one result. How do i increase the number of results I get back? http://nominatim.openstreetmap.org/search?format=xml&q=41.760584,-88.320071 That returns only one place thats at that specific lat lon. http://nominatim.openstreetmap.org/search?format=xml&viewbox=-88.85,42.25,-87.65,41.05&q=coffee&bounded=1&limit=100 That returns a few (<100) coffee shops in the bounding box, however, they are definitely not all. Finally, if I want all places in the bounding box, (so if I omit the "q" param) I dont get any results at all. So, how to really do this? Best, Sachin Dole
This question is marked "community wiki".
asked 19 Jul '12, 20:26 sdole |
See the Overpass API or the XAPI. answered 19 Jul '12, 21:31 hfs Yes, it has such function, but how to search for random query input? What would be equal to "search?q=*" of Nominatim API. Overpass API has tags like "name", "amenity" and so on but they are useless 'cause API expect full match (100%) with query you input for searching, so it doesn't work like Nominatim API or Google Search
(06 Nov '18, 14:09)
user5555
|
As written before: If you want for example all schools around the coordinate 41.76 north 88.32 east, please use [http://overpass-api.de/api/interpreter?data=(way(bbox)[amenity=school];>;node(bbox)[amenity=school];);out;&bbox=-88.4,41.7,-88.3,41.8][1] Similarly, you can get all cafes with [http://overpass-api.de/api/interpreter?data=(way(bbox)[amenity=cafe];>;node(bbox)[amenity=cafe];);out;&bbox=-88.4,41.7,-88.3,41.8][2] Apparently, there are none in the database. You also don't see any on the Mapnik map there. The location is specified as bounding box. Thus, the radius is controlled by the difference between the two longitude or latitude values. answered 23 Jul '12, 08:57 Roland Olbricht |
Nominatim understands the near keyword to search for certain POI types around a coordinate. For example, you can ask for schools around a geo point like this: http://nominatim.openstreetmap.org/search?q=school near [41.760584,-88.320071] The types of POIs that Nominatim currently understands are listed on this page of special phrases. Note however, this query will not necessarily get you all the schools in the area but only a selection. Nominatim is a search tool after all, not a tool for downloading data. If you need complete lists, the Overpass or XAPI are indeed better suited. answered 23 Jul '12, 22:57 lonvia Such a bad api. If I want to search for school in my language (Russian) I have to replace "near" to my language as well, школа возле [41.760584,-88.320071]. I can't do it programmatically for all languages and how I'm supposed to detect the language user types.
(06 Nov '18, 14:05)
user5555
1) There is Overpass API which might be better suited for your use case.
2) Detecting the user language can be done by looking at the browser's language setting, i.e. at the
(06 Nov '18, 14:30)
scai ♦
|