In my previous post, i have explained how to consume ESRI Rest API for reverse geocoding. In this Article i will explain how to use "nominatim" for reverse geo-coding.
Nominatim (from the Latin, 'by name') is a tool to search OSM data by name and address and to generate synthetic addresses of OSM points (reverse geocoding). It can be found at nominatim.openstreetmap.org.
Nominatim is also used as one of the sources for the search box on the OpenStreetMap home page. Several companies provide hosted instances of Nominatim that you can query via an API,
Just like in my earlier blog, i took Charminar coordinates for testing!
ReverseGeocoding- xml URL
https://nominatim.openstreetmap.org/reverse?format=xml&lat=17.3616&lon=78.4747&zoom=18&addressdetails=1
--XML RESPONSE FROM NOMINATIM SERVER----------
<reversegeocode timestamp="Mon, 10 Dec 18 09:29:01 +0000" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" querystring="format=xml&lat=17.3616&lon=78.4747&zoom=18&addressdetails=1">
<result place_id="133270429" osm_type="way" osm_id="238186115" ref="Charminar" lat="17.3616024" lon="78.4746421377397" boundingbox="17.3614645,17.3617436,78.4744871,78.4747917">
Char Minar, Charminar Circle, Ward 49 Ghansi Bazar, Greater Hyderabad Municipal Corporation South Zone, Hyderabad, Telangana, 500002, India
</result>
<addressparts>
<attraction>Char Minar</attraction>
<road>Charminar Circle</road>
<suburb>Ward 49 Ghansi Bazar</suburb>
<city_district>Greater Hyderabad Municipal Corporation South Zone</city_district>
<city>Hyderabad</city>
<state_district>Hyderabad</state_district>
<state>Telangana</state>
<postcode>500002</postcode>
<country>India</country>
<country_code>in</country_code>
</addressparts>
</reversegeocode>
-----END OF RESPONSE------------------------------------
ReverseGeocoding- jsonv2 url
https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=17.3616&lon=78.4747
-----JSON RESPONSE FROM NOMINATIM SERVER--------
{"place_id":"133270429","licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"way","osm_id":"238186115","lat":"17.3616024","lon":"78.4746421377397","place_rank":"30","category":"tourism","type":"attraction","importance":"0.392830388816127","addresstype":"tourism","name":"Char Minar","display_name":"Char Minar, Charminar Circle, Ward 49 Ghansi Bazar, Greater Hyderabad Municipal Corporation South Zone, Hyderabad, Telangana, 500002, India","address":{"attraction":"Char Minar","road":"Charminar Circle","suburb":"Ward 49 Ghansi Bazar","city_district":"Greater Hyderabad Municipal Corporation South Zone","city":"Hyderabad","state_district":"Hyderabad","state":"Telangana","postcode":"500002","country":"India","country_code":"in"},"boundingbox":["17.3614645","17.3617436","78.4744871","78.4747917"]}
-----END OF RESPONSE------------------------------------
See you guys in my next Article! you can reach me at sree@itoolz.in for any info
Nominatim (from the Latin, 'by name') is a tool to search OSM data by name and address and to generate synthetic addresses of OSM points (reverse geocoding). It can be found at nominatim.openstreetmap.org.
Nominatim is also used as one of the sources for the search box on the OpenStreetMap home page. Several companies provide hosted instances of Nominatim that you can query via an API,
Just like in my earlier blog, i took Charminar coordinates for testing!
ReverseGeocoding- xml URL
https://nominatim.openstreetmap.org/reverse?format=xml&lat=17.3616&lon=78.4747&zoom=18&addressdetails=1
--XML RESPONSE FROM NOMINATIM SERVER----------
<reversegeocode timestamp="Mon, 10 Dec 18 09:29:01 +0000" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" querystring="format=xml&lat=17.3616&lon=78.4747&zoom=18&addressdetails=1">
<result place_id="133270429" osm_type="way" osm_id="238186115" ref="Charminar" lat="17.3616024" lon="78.4746421377397" boundingbox="17.3614645,17.3617436,78.4744871,78.4747917">
Char Minar, Charminar Circle, Ward 49 Ghansi Bazar, Greater Hyderabad Municipal Corporation South Zone, Hyderabad, Telangana, 500002, India
</result>
<addressparts>
<attraction>Char Minar</attraction>
<road>Charminar Circle</road>
<suburb>Ward 49 Ghansi Bazar</suburb>
<city_district>Greater Hyderabad Municipal Corporation South Zone</city_district>
<city>Hyderabad</city>
<state_district>Hyderabad</state_district>
<state>Telangana</state>
<postcode>500002</postcode>
<country>India</country>
<country_code>in</country_code>
</addressparts>
</reversegeocode>
-----END OF RESPONSE------------------------------------
ReverseGeocoding- jsonv2 url
https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=17.3616&lon=78.4747
-----JSON RESPONSE FROM NOMINATIM SERVER--------
{"place_id":"133270429","licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"way","osm_id":"238186115","lat":"17.3616024","lon":"78.4746421377397","place_rank":"30","category":"tourism","type":"attraction","importance":"0.392830388816127","addresstype":"tourism","name":"Char Minar","display_name":"Char Minar, Charminar Circle, Ward 49 Ghansi Bazar, Greater Hyderabad Municipal Corporation South Zone, Hyderabad, Telangana, 500002, India","address":{"attraction":"Char Minar","road":"Charminar Circle","suburb":"Ward 49 Ghansi Bazar","city_district":"Greater Hyderabad Municipal Corporation South Zone","city":"Hyderabad","state_district":"Hyderabad","state":"Telangana","postcode":"500002","country":"India","country_code":"in"},"boundingbox":["17.3614645","17.3617436","78.4744871","78.4747917"]}
-----END OF RESPONSE------------------------------------
See you guys in my next Article! you can reach me at sree@itoolz.in for any info
Comments
Post a Comment