0

We have to reverse geocode 1000's of address and want the output of the queries in a csv/txt format. Currently if i run this query in a browser

https://nominatim.openstreetmap.org/reverse?format=xml&lat=15.052367&lon=-23.4668449999999&zoom=18&addressdetails=1

getting proper results

    <result place_id="162512055" osm_type="way" osm_id="388397021" ref="Ribeira de São Domingos" lat="15.0517782" lon="-23.4655677" boundingbox="15.0345067,15.052133,-23.4811055,-23.4651987">
Ribeira de São Domingos, Achada Baleia, São Domingos, Cape Verde
    </result>
    <addressparts>
    <road>Ribeira de São Domingos</road>
    <village>Achada Baleia</village>
    <county>São Domingos</county>
    <country>Cape Verde</country>
    <country_code>cv</country_code>
    </addressparts>
    </reversegeocode>

How to save this output directly to a csv or a txt file with respective headers ?

1
  • 1
    Do you have any programming language knowledge?
    – Spacedman
    Commented Dec 31, 2018 at 9:46

1 Answer 1

1

By default the Nominatim API does not accept csv as output format, only xml, html, json, and jsonv2 (like json but with more output fields)

If you can get the results in json format, you can convert them afterwards with an online tool like this one (but there are several others available, just search for "json to csv").

There are also some libraries and apps, that allow you to do bulkgeocoding, a quick search show for example this one, that allows the use of different providers.

If you need some automated process a couple of lines of python can do the work. Just specify your exact requirements and if you are confortable executing a python script and i can share an example.

BTW about bulk geocoding and requests per second read the Acceptable Usage Policy for the Nominatim API of OSM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.