Monthly Archives: August 2012

Geographic computing – Lat Lon or Lon Lat?

Just encountered a bug in my code where I swapped the order or lat and lon values. It is so easy to apply the wrong order and not finding it. In fact my algorithm works despite I swapped the coordinates. Only a after I notice a slight deviation from the expected result did I start an extensive investigation and identified the mistake.

Is there a standard order to express the coordinate in computing system? It seems the only way to make software reliable is to adopt a consistent order. So I looked at several software system. Here is what I find.

Lat Lon Order

Lon Lat Order

  • GeoJSON – The order of elements must follow x, y, z order (longitude, latitude, altitude, …)
  • KML – <gx:coord> A coordinate value consisting of three values for longitude, latitude, and altitude, … Also the values are explicitly tagged as XML element.

There is not a consistent order used in the field. In addition there is also variation of the 3 letter shorthand for longitude – lng v.s. lon. Sigh… No wonder I have messed up.

This is what I’m going to use – lat, lon, so as to follow the verbal convention.


Leave a comment

Filed under Uncategorized

MUNI all door boarding

Muni’s systemwide all-door boarding start in July 2012. Now that 1 month has passed, people should start to get used to being able to board at the back door. Let’s see if we can measure a difference in performance.

Leave a comment

Filed under Uncategorized