Bangkok Reverse Geoencoding Challenges

As I’ve mentioned before, e.g. here I like to geoencode all my pictures with the latitude and longitude where the picture was taken. I also like to use that information to fill in the “location” fields in the photo’s IPTC information with the location in English. the latter process is called Reverse Geocoding.

I used Jeff Friedl’s excellent GPS Plugin for Lightroom for both tasks. Recently though I have been unable to reverse geocode many of my photos taken in Bangkok. Instead I get an error dialog box like this:

Lightroom Geocode Internal Error

Lightroom Geocode Internal Error

It does not happen for all locations. I reported the issue to Jeff and sent him a log file. I looked at the log file: Jeff showed great foresight in making his plugin write extensive logging information. It did not help me understand the error but it did give me an insight on how complex the reverse geocoding process is.

In the case of this test photo taken at +13° 44′ 12.15N, +100° 33′ 39.13W :

Geocoding Test Photo

Geocoding Test Photo - Click for a Larger Picture

Google returns eight choices for the address:

  1. “ถนนสุขุมวิท, Khlong Tan Nuea, Vadhana, Bangkok 10110, Thailand” (Sukhumvit Road)
  2. “อโศก, Khlong Tan Nuea, Vadhana, Bangkok 10110, Thailand” (Asok)
  3. “Asok BTS Station, Khlong Tan Nuea, Vadhana, Bangkok 10110, Thailand”
  4. “Asok Station, Khlong Tan Nuea, Vadhana, Bangkok 10110, Thailand”
  5. “แยกสุขุมวิท-อโศก, Khlong Tan Nuea, Vadhana, Bangkok 10110, Thailand” (Sukhumvit & Asok)
  6. “สุขุมวิท ซอย 20, Khlong Tan Nuea, Vadhana, Bangkok 10110, Thailand” (Sukhumvit Soi 20)
  7. “Vadhana, Khlong Tan Nuea, Vadhana, Bangkok, Thailand”
  8. “Khlong Tan Nuea, Vadhana, Bangkok, Thailand”

Some parts of the address are in Thai.

Jeff has to parse them into four fields that IPTC allows:

  1. Location
  2. City
  3. State / province
  4. Country

Bangkok is both a city and a state. It is divided into fifty districts (khet – เขต). Each khet is made up of a number of neighbourhoods (khwaeng – แขวง).

That terminology is unique to Bangkok. The equivalent term in other provinces is amphoe – อำเภอ and tambon – ตำบล.

When it works Jeff’s plugin has been allocating the fields thus:

  • Location : blank
  • City : Khlong Tan Heua (the khwaeng)
  • State : Bangkok
  • Country : Thailand

I can live with that but I’d prefer

  • Location : Asok BTS Station
  • City : Vadhana (the khet)

That’s choice #3. But I cannot expect Jeff to make a special case of Bangkok addresses and for all I know the information returned by Google may not be consistent for all addresses in Bangkok.

I’ll update this post with comments when Jeff posts an update to the plugin.

Incidentally, I hope Adobe retain Jeff on a consulting contract to ensure that his plugins work with Lightroom 3. They could also use his help in making the plugin architecture more flexible and less restrictive. For example, the way he has to maintain “Shadow GPS Data” causes many users a lot of frustration.


Tags: , ,

4 Responses to “Bangkok Reverse Geoencoding Challenges”

  1. maewnam Says:

    While if you only have photos from Bangkok using the Khwaeng as the city would work, but the Tambon have no unique names – there are 28 Tambon named Nong Bua. And even the districts (Amphoe) are not completely unique due to the 5 named Chaloem Phra Kiat. So the only unambiguous way would be to use the full hierarchy – changwat (or Bangkok), Amphoe, Tambon.

    And another problem – just recently 9 new Khwaeng were created, and another bunch is scheduled for next year but I have no details about those yet. So while the actual coordinates continue to be correct, the city field might get outdated.

    • BKKPhotographer Says:

      Yes, ideally IPTC would provide four fields. Then I am sure Jeff’s plugin would use them. I’m going to try to persuade him to plug the khet into the city field rather than the khwaeng.

  2. BKKPhotographer Says:

    I just downloaded version 99 of the plugin. It works fine in that I can reverse geocode my Bangkok photos without an error.

    I commented on Jeff’s blog at

  3. GeoURL Service « Bkkphotographer's Blog Says:

    […] The way they state Bangkok addresses is strange. That’s probably for the same reasons that Jeff Friedl’s Reverse Geocoding for pictures in Lightroom is so problematic – inconsistent address formats around the […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: