browse by category or date

Still related to my last post, today we found another issue with Google Maps. This time, the issue is related to postal code resolution. As you can try yourself, we can enter a postal code in Google Maps, and we will see the correct location appear in the map.

After testing with a few test cases, it seems the result given by Google Maps API is not consistent. For example, examine these three URLs and compare their result:

URL A: Postal Code: 489949
URL B: Postal Code: 529684
URL C: Postal Code: 163009

Result A:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "489949",
               "short_name" : "489949",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "Tampines",
               "short_name" : "Tampines",
               "types" : [ "neighborhood", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Singapore 489949",
         "geometry" : {
            "location" : {
               "lat" : 1.334575,
               "lng" : 103.949792
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.335923980291502,
                  "lng" : 103.9511409802915
               },
               "southwest" : {
                  "lat" : 1.333226019708498,
                  "lng" : 103.9484430197085
               }
            }
         },
         "place_id" : "ChIJh2cj7y892jERKFBGlnIii7Q",
         "types" : [ "postal_code" ]
      }
   ],
   "status" : "OK"
}

Result B:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "529684",
               "short_name" : "529684",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "51 Tampines Avenue 4, Singapore 529684",
         "geometry" : {
            "location" : {
               "lat" : 1.3527668,
               "lng" : 103.940085
            },
            "location_type" : "GEOMETRIC_CENTER",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.354115780291502,
                  "lng" : 103.9414339802915
               },
               "southwest" : {
                  "lat" : 1.351417819708498,
                  "lng" : 103.9387360197085
               }
            }
         },
         "place_id" : "ChIJ2QytGRM92jERrMbjLH1pYVU",
         "types" : [ "establishment", "point_of_interest" ]
      }
   ],
   "status" : "OK"
}

Result C:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "9B",
               "short_name" : "9B",
               "types" : [ "street_number" ]
            },
            {
               "long_name" : "Boon Tiong Road",
               "short_name" : "Boon Tiong Rd",
               "types" : [ "route" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "163009",
               "short_name" : "163009",
               "types" : [ "postal_code" ]
            }
         ],
         "formatted_address" : "9B Boon Tiong Road, Tiong Bahru View, Singapore 163009, 9B Boon Tiong Rd, Singapore 163009",
         "geometry" : {
            "location" : {
               "lat" : 1.2868142,
               "lng" : 103.8289788
            },
            "location_type" : "ROOFTOP",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.288163180291502,
                  "lng" : 103.8303277802915
               },
               "southwest" : {
                  "lat" : 1.285465219708498,
                  "lng" : 103.8276298197085
               }
            }
         },
         "place_id" : "ChIJEZ_eH3kZ2jER_IcZMYi6gfQ",
         "types" : [ "establishment", "point_of_interest" ]
      }
   ],
   "status" : "OK"
}

So we can see here that we can’t rely on the postal code to get the address. But if we use the lat and long given in the result A, it will actually gives us the correct address 😀

URL A: Lat: 1.334575, Long: 103.949792:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "11",
               "short_name" : "11",
               "types" : [ "street_number" ]
            },
            {
               "long_name" : "Bedok North Avenue 4",
               "short_name" : "Bedok North Ave 4",
               "types" : [ "route" ]
            },
            {
               "long_name" : "Tampines",
               "short_name" : "Tampines",
               "types" : [ "neighborhood", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "489949",
               "short_name" : "489949",
               "types" : [ "postal_code" ]
            }
         ],
         "formatted_address" : "11 Bedok North Ave 4, Singapore 489949",
         "geometry" : {
            "location" : {
               "lat" : 1.334575,
               "lng" : 103.949792
            },
            "location_type" : "ROOFTOP",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.335923980291502,
                  "lng" : 103.9511409802915
               },
               "southwest" : {
                  "lat" : 1.333226019708498,
                  "lng" : 103.9484430197085
               }
            }
         },
         "place_id" : "ChIJb90H5S892jER41OGX1qDRV0",
         "types" : [ "street_address" ]
      },
      {
         "address_components" : [
            {
               "long_name" : "Opp Blk 3011",
               "short_name" : "Opp Blk 3011",
               "types" : [
                  "bus_station",
                  "establishment",
                  "point_of_interest",
                  "transit_station"
               ]
            },
            {
               "long_name" : "Tampines",
               "short_name" : "Tampines",
               "types" : [ "neighborhood", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Opp Blk 3011, Singapore",
         "geometry" : {
            "location" : {
               "lat" : 1.3347473,
               "lng" : 103.9502402
            },
            "location_type" : "GEOMETRIC_CENTER",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.336096280291502,
                  "lng" : 103.9515891802915
               },
               "southwest" : {
                  "lat" : 1.333398319708498,
                  "lng" : 103.9488912197085
               }
            }
         },
         "place_id" : "ChIJl27l8S892jERJRTu-a5zeOo",
         "types" : [
            "bus_station",
            "establishment",
            "point_of_interest",
            "transit_station"
         ]
      },
      {
         "address_components" : [
            {
               "long_name" : "Tampines",
               "short_name" : "Tampines",
               "types" : [ "neighborhood", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Tampines, Singapore",
         "geometry" : {
            "bounds" : {
               "northeast" : {
                  "lat" : 1.375747,
                  "lng" : 103.985835
               },
               "southwest" : {
                  "lat" : 1.3144619,
                  "lng" : 103.924219
               }
            },
            "location" : {
               "lat" : 1.3495907,
               "lng" : 103.9567879
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.375747,
                  "lng" : 103.985835
               },
               "southwest" : {
                  "lat" : 1.3144619,
                  "lng" : 103.924219
               }
            }
         },
         "place_id" : "ChIJ0e4CNAQ92jERy_T_mqOSB48",
         "types" : [ "neighborhood", "political" ]
      },
      {
         "address_components" : [
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Singapore",
         "geometry" : {
            "bounds" : {
               "northeast" : {
                  "lat" : 1.4708809,
                  "lng" : 104.0415799
               },
               "southwest" : {
                  "lat" : 1.216611,
                  "lng" : 103.6065099
               }
            },
            "location" : {
               "lat" : 1.3553794,
               "lng" : 103.8677444
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.470624,
                  "lng" : 104.0414138
               },
               "southwest" : {
                  "lat" : 1.2205143,
                  "lng" : 103.6097687
               }
            }
         },
         "place_id" : "ChIJyY4rtGcX2jERIKTarqz3AAQ",
         "types" : [ "locality", "political" ]
      },
      {
         "address_components" : [
            {
               "long_name" : "489949",
               "short_name" : "489949",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "Tampines",
               "short_name" : "Tampines",
               "types" : [ "neighborhood", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Singapore 489949",
         "geometry" : {
            "location" : {
               "lat" : 1.334575,
               "lng" : 103.949792
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.335923980291502,
                  "lng" : 103.9511409802915
               },
               "southwest" : {
                  "lat" : 1.333226019708498,
                  "lng" : 103.9484430197085
               }
            }
         },
         "place_id" : "ChIJh2cj7y892jERKFBGlnIii7Q",
         "types" : [ "postal_code" ]
      },
      {
         "address_components" : [
            {
               "long_name" : "489948",
               "short_name" : "489948",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "Tampines",
               "short_name" : "Tampines",
               "types" : [ "neighborhood", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "Singapore",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Singapore 489948",
         "geometry" : {
            "location" : {
               "lat" : 1.335123,
               "lng" : 103.949641
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.336471980291502,
                  "lng" : 103.9509899802915
               },
               "southwest" : {
                  "lat" : 1.333774019708498,
                  "lng" : 103.9482920197085
               }
            }
         },
         "place_id" : "ChIJz0_K_i892jERKuoi1XSScek",
         "types" : [ "postal_code" ]
      },
      {
         "address_components" : [
            {
               "long_name" : "Singapore",
               "short_name" : "SG",
               "types" : [ "country", "political" ]
            }
         ],
         "formatted_address" : "Singapore",
         "geometry" : {
            "bounds" : {
               "northeast" : {
                  "lat" : 1.4784001,
                  "lng" : 104.0945001
               },
               "southwest" : {
                  "lat" : 1.1496,
                  "lng" : 103.594
               }
            },
            "location" : {
               "lat" : 1.352083,
               "lng" : 103.819836
            },
            "location_type" : "APPROXIMATE",
            "viewport" : {
               "northeast" : {
                  "lat" : 1.4707592,
                  "lng" : 104.0884808
               },
               "southwest" : {
                  "lat" : 1.1587023,
                  "lng" : 103.6055575
               }
            }
         },
         "place_id" : "ChIJdZOLiiMR2jERxPWrUs9peIg",
         "types" : [ "country", "political" ]
      }
   ],
   "status" : "OK"
}

I guess we need to find another way to consistently able to resolve postal code. 🙁

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

My team have rolled out our Android application (more about this in future post) for the drivers to do the electronic POD (Proof of Delivery). It’s been two weeks of smooth sailing with minor issues, until today. Today we received complain from one of the Traffic Controller (the guy who assigns jobs to the driver) saying that the map showing the address incorrectly. The address, 11 Paya Lebar Road is shown in the middle of PIE.

In comparison, we tried to search on streetDirectory.com and WeGo.here.com

StreetDirectory.com: The “Right Here” vs the G (Google’s result)

wego.here.com

wego.here.com: The checkered circle vs Google’s Result

Well this is unexpected. I would expect that a tech giant like Google would point a location in Singapore correctly. After all, Singapore is the most connected country in the world. But in this case Google actually missed by … Hold on.. let me Google that for you …

It missed by 900 meters. I do hope Google will quickly look into this. We don’t want to rewrite our mobile apps using other mapping API. 🙁

PS: If you are in Singapore, you will find this mistake on Uber or Grab (they are using Google Maps in their mobile Apps) by entering 11 Paya Lebar Road as your destination.

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

I’m just starting my journey to gain “MBA” knowledge through the cheapest route. So instead of burning time and tens thousands of dollars, I’ll just read the book below:



As I progressed through the pages, I’ll write down findings that I found really interesting. The first thing that I found was the definition of business. Business is a repeatable process that:

  1. creates and delivers something of value …
  2. that other people want or need …
  3. at a price they’re willing to pay …
  4. in a way that satisfies the customer’s needs and expectations …
  5. so that the business brings in enough profit to make it worthwhile for the owners to continue operations

I like this definition. I found it concise, easy to remember, and become a very good topic for discussion after lunch! 😀 Lately my lunches hasn’t been boring whenever I brought up this topic.

More to come!

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: