3. Understanding Reverse Geocode Response
Every reverse geocode provider has its data and they also represent it very differently. The information returned from reverse geocode provider is different or may differ in the level of detail. As there is no way to generalize every reverse geocode provider's response into the same address administrative level, users must understand the response returned from their selected reverse geocode provider.
There is two way to understand the reverse geocoding response.
Easy Way To Inspect Reserve Geocode Response
photo-cli
has a feature to extract and list the response of each reverse geocode provider. If you are using a reverse geocode provider that needs an API key, first you need to get it from the provider and set API key.
Listing Reverse Geocode Response. Ref: reverse geocode provider command line arguments
photo-cli address --input [input-file.jpg] --reverse-geocode [selected-reverse-geocode-provider]`
For example, a photo was taken on Anıtkabir(place), Çankaya(town), Ankara(city), Turkey(country) with coordinate as 39.925054
and longitude
as 32.8347552
(Coordinate in Google Maps) responses should be like the following.
Big Data Cloud
photo-cli address -i DSC_7082.jpg -e 1
AdminLevel2: Turkey
AdminLevel3: Central Anatolia Region
AdminLevel4: Ankara Province
AdminLevel6: Çankaya
AdminLevel8: Mebusevleri Mahallesi
Open Street Map - Nominatim
photo-cli address -i DSC_7082.jpg -e 2
CountryCode: tr
Country: Türkiye
Region: İç Anadolu Bölgesi
Province: Ankara
City: Ankara
Town: Çankaya
Postcode: 06430
Suburb: Yücetepe Mahallesi
Road: İlk Sokak
Military: Anıtkabir
Google Maps
photo-cli address -i DSC_7082.jpg -e 3
plus_code: WRGM+2W
administrative_area_level_2: Çankaya
administrative_area_level_1: Ankara
country: Turkey
route: Anıtkabir
administrative_area_level_4: Mebusevleri
postal_code: 06570
street_number: 108
Map Quest
photo-cli address -i DSC_7082.jpg -e 4
CountryCode: tr
Country: Türkiye
City: Ankara
Postcode: 06580
Suburb: Mebusevleri Mahallesi
Location Iq
photo-cli address -i DSC_7082.jpg -e 5
CountryCode: tr
Country: Turkey
Region: Central Anatolia Region
Province: Ankara
City: Ankara
Town: Çankaya
Postcode: 06570
Suburb: Yücetepe Mahallesi
Road: Ata Sokak
Barracks: Anıtkabir
Power User Way To Inspect Reserve Geocode Response
You should inspect the reverse geocode provider's response with the locations you occasionally take photographs. After getting the response, you can send the properties as an argument of your choice of the administrative level you want to build an address for each photograph.
Using HTTP Files
To trigger HTTP files you may use Visual Studio Code with the extension REST Client or any IntelliJ IDE's.
You may replace {{ApiKey}}
in the address with your API key or you can use the IntelliJ environment variable file.
Reverse Geocode Provider | HTTP File |
---|---|
BigDataCloud | big-data-cloud.http |
Open Street Map Foundation - Nominatim | open-street-map.http |
GoogleMaps | google-maps.http |
LocationIq | location-iq.http |
Using Postman
You may import photo-cli | Reverse Geocode collection into Postman.
You should prepare the following environment variables on Postman.
Reverse Geocode Provider | Postman Environment Variable |
---|---|
BigDataCloud | BigDataCloud-ApiKey |
Open Street Map Foundation - Nominatim | - |
GoogleMaps | GoogleMaps-ApiKey |
LocationIq | LocationIq-ApiKey |
Sample Responses
Sample responses in JSON format are listed below from each reverse geocode for the coordinate with latitude as 39.925054
and longitude as 32.8347552
(Coordinate in Google Maps).
Reverse Geocode Provider | Sample Response |
---|---|
BigDataCloud | big-data-cloud.json |
Open Street Map Foundation - Nominatim | open-street-map.json |
GoogleMaps | google-maps.json |
LocationIq | location-iq.json |