5 ms·
The nominatim service will provide you with a lat/lon: $ curl -s 'https://nominatim.openstreetmap.org/search?q=36%20Quai%20des%20Orfevres%20Paris&format=js
by skywal_l 5y ago
The nominatim service will provide you with a lat/lon:
$ curl -s 'https://nominatim.openstreetmap.org/search?q=36%20Quai%20des%20Orfevres%20Paris&format=json' | jq .
[
{
"place_id": 5797794,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
"osm_type": "node",
"osm_id": 676748219,
...
"lat": "48.8554631",
"lon": "2.3430218",
...
}
]
- littlestymaar 5y agoJust be cautious with nominatim's rate limiting: you'll get banned pretty quickly if you ever put such queries in a script without a delay between different queries, a dozen of queries run in parallel or close together is enough. (been there, done that)
- skywal_l 5y agoYes indeed. Note that you can always run your own nominatim service :) https://hub.docker.com/r/mediagis/nominatim/ https://hub.docker.com/r/mediagis/nominatim/
- littlestymaar 5y agoI wanted to get the location for literally 48 addresses (I just wanted to get the location of all the nanny around my home!), clearly running a nominatim instance wasn't an option but I didn't expect my little script to get me banned instantly… Fortunately the ban wasn't that long and the next day I managed to get the list I wanted, after putting a one-second delay between each API call.