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

Hi, 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 9 years.

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

Hi, 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 9 years.

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

Hi, 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 9 years.

Feynman technique is a method to help you to learn basically anything, faster. The technique is named after Richard Feynman, a Noble Prize winner physicist. The technique consists of 4 steps:

  1. Title
    Write the name of the concept at the top of a blank paper (or make it a blog title)
  2. Simple Explanation
    Explain and elaborate the concept using simple terms (non-technical), perhaps analogy, as if you explain the concept to a child (person who is totally clueless about the concept)
  3. Find What You Don’t Know
    While doing step 2, you might find things that you can’t explain.So write the name of these difficult concept as the sub-title, read books/materials to understand the concept, then repeat step 2.
  4. Review
    Check to ensure that all explanations are using simple terms. If you find any explanation that is simply para-phrasing the source material, simplify it. Add analogy or maybe simple visual aid.

PS: I was feynmanning this from http://mattyford.com/blog/2014/1/23/the-feynman-technique-model

Let’s start learning again 🙂

About Hardono

Hi, 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 9 years.

After recent Windows 10 System update (I am using Insider Preview), my Xamarin Android Player (XAP) refused to work. Everytime I tried to start the emulator, it will prompt error.

DeviceManager_2016-05-07_01-03-03

Error! The details is in the log file (if you can find it)

Error! The details is in the log file (if you can find it)

Since I don’t know where the log file is located, I just run the VM from VirtualBox. This time, I got more informative error message.
VirtualBox_2016-05-07_00-56-35

Details of my system:

  • Windows 10 Insider Preview. Build 1433.rs1_release.160422-1940
  • VirtualBox 5.0.20 r106931
  • Xamarin Android Player 0.6.5

From the error message, it seems something wrong with the VM’s network option. Looking into VirtualBox’s network settings, I don’t see anything amiss.

File -> Preference

File -> Preference

VirtualBox_2016-05-07_01-38-25

VirtualBox_2016-05-07_01-38-33

The network settings are already follow the recommended values. Perhaps we can find something in Windows’ network settings (Win-R, ncpa.cpl, ENTER)

Right-Click, Properties

Right-Click, Properties

dllhost_2016-05-07_01-45-52

Hmm…VirtualBox NDIS6 Bridged Networking Driver strangely is not checked. Could this be the cause? Let’s just check that and try to start the XAP again.

chrome_2016-05-07_01-51-41

It works! Heng ah! 😀

About Hardono

Hi, 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 9 years.

Today I installed Ionic Pack for Visual Studio 2015. This extension will provide IntelliSense when editing Ionic’s HTML source code.

Unfortunately, this extension will clashed with ReSharper’s HTML IntelliSense. Here’s how to disable it.

  1. Open ReSharper’s Option
    devenv_2016-05-05_16-57-23
  2. Select IntelliSense -> General
    devenv_2016-05-05_16-59-16
  3. Select Custom IntelliSense
    devenv_2016-05-05_17-01-15

This way, I enable ReSharper only when editing .cs files. And it works!
devenv_2016-05-05_17-03-58

That’s all. I hope it helps.

About Hardono

Hi, 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 9 years.