3 ms·
osmf <lat> <long> <radius_meter> [way_area<<value>] [way_area><value>] [<tag>=<value>]... Cool, but I often start my with a place name, as opposed to lat/long.
by morsch 5y ago
osmf <lat> <long> <radius_meter> [way_area<<value>] [way_area><value>] [<tag>=<value>]...
Cool, but I often start my with a place name, as opposed to lat/long.
osmf $(oslatlong "Berlin, Germany") <radius_meter> [way_area<<value>] [way_area><value>] [<tag>=<value>]...
Unfortunately, oslatlong doesn't exist, but maybe something else does the job?
- skywal_l 5y agoThe 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.
- oogali 5y agoHere's a quick and dirty implementation. https://github.com/oogali/oslatlong https://github.com/oogali/oslatlong
- morsch 5y agoAwesome!