This Google Maps link returns train stations in Shanghai, China. By appending '&output=js' it returns it in JSON format. I'm trying to decode the format Google uses for lat/lon:


For all other countries, Google returns the lat lon values separated in the lat and lon . Only for China they return this strange ll value. Does anybody know how to decode it?

  • At first glance, it looks like a lat, lng in decimal degrees (35.1221317, 135.74191160)...not sure if it's actually that simple. A brief search didn't turn up any documentation on this so I'm just posting a comment...maybe someone else with have more concrete insight. – Derek Swingley Dec 8 '10 at 14:56
  • @Swingley: Unfortunately, that's not true. Shanghai is at 31.2,121.5. – Ortwin Gentz Dec 8 '10 at 15:00
  • Alt= height above sea level - so it's 11m – Mapperz Dec 8 '10 at 15:11
  • 2
    @Mapperz: 11m? How do you come to that value? And what does that long 35122131713574191160 number mean, then? – Ortwin Gentz Dec 8 '10 at 15:15
  • gmaps-samples.googlecode.com/svn/trunk/geocoder/… works in English. – Mapperz Dec 8 '10 at 15:48

It isn't clear that the returned ll value encodes the latitude and longitude, it may just be some other piece of information they embed with the results. If it does encode the latitude and longitude, I'd go looking the way of geohashing and coordinate interleaving, both of which provide a conversion mechanism between single strings and a coordinate pair. If you're convinced that they are related, try gathering up a collection of values and try your hand at a linear solver or the like to deduce their relationship.

  • Thanks, good suggestion. Not sure though, I'm able to do the math to solve it. I'll extract some values and see if a relationship seems obvious. – Ortwin Gentz Dec 13 '10 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.