I've constructed the following query, I want to get "hospitals" which is a special phrase according to this link https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases/EN This is my query those GPS coordinates are from Pittsburgh, PA. But the results contains results from Nicaragua and Libya and they are not hospitals. Where have I made a mistake? |
A special phrase just means that nominatim will give some preference to items tagged amenity=hospital, it's still doing name matching on "Hospitals", so it's returning things with exactly that name. Here's an example Overpass-API query that returns hospitals within a 10 Km radius of that location. Note that you can use that query outside of Overpass Turbo, it's just a convenient way to share it. You could also compute a bounding box from the coordinate and restrict the search to that area, if that were more suitable for your goal. Hello. Is something like that available for Nominatim API?
(05 Nov '18, 10:17)
user5555
Not beyond what is mentioned in the other answer.
(05 Nov '18, 10:46)
maxerickson
There isn't.
(05 Nov '18, 10:47)
mtmail
Ok, thanks. Now I want to try Overpass-API. How to send just query using REST API (POST some json url)? And where to get results? Because your example draws on the map, but I want result in text format (json)
(06 Nov '18, 11:48)
user5555
Never mind. Found out https://www.overpass-api.de/api/interpreter?data=THE SAME QUERY AS IN YOUR EXAMPLE, BUT EVERYTHING IN ONE LINE
(06 Nov '18, 12:04)
user5555
And one more question - how to search for any building/place using any name? So it can be anything, not necessarily hospital. I tried replace "amenity" with "name", but it does't work like with Nominatim API, it excepts name which will match 100%, but I want just normal name query (like we search in Google and in Nominatim API)
(06 Nov '18, 13:55)
user5555
Don't add questions to answers. Instead create a new question.
(06 Nov '18, 14:31)
scai ♦
showing 5 of 7
show 2 more comments
|
The /search endpoint doesn't understand &lat or &lon parameters (only /reverse does), setting &polygon= to 50 has the same effect as 1 and only affects the output. See https://wiki.openstreetmap.org/wiki/Nominatim#Search The closest you can get with Nominatim is using a query 'hospitals near 40.406932,-79.932963'. The 'near' (or 'in') is optional. You can set the &limit=50 to get more results (maximum is 100). The Overpass-API system is more flexible (support more types of point-of-interest, more filters, better control over the search radius) overall. I like using the "hospital near 40.406932,-79.932963" method, but at some places it returns nothing. Is there a way to increase the sq miles it checks?
(01 Aug '18, 21:26)
Dave4784
Nominatim doesn't have a parameter for that.
(06 Aug '18, 11:13)
mtmail
|