Skip to main content

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.

  1. Easy Way To Inspect Reserve Geocode Response
  2. Power User Way To Inspect Reserve Geocode 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 ProviderHTTP File
BigDataCloudbig-data-cloud.http
Open Street Map Foundation - Nominatimopen-street-map.http
GoogleMapsgoogle-maps.http
LocationIqlocation-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 ProviderPostman Environment Variable
BigDataCloudBigDataCloud-ApiKey
Open Street Map Foundation - Nominatim-
GoogleMapsGoogleMaps-ApiKey
LocationIqLocationIq-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 ProviderSample Response
BigDataCloudbig-data-cloud.json
Open Street Map Foundation - Nominatimopen-street-map.json
GoogleMapsgoogle-maps.json
LocationIqlocation-iq.json