Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I just found out that you can add a geographic component to a QR code.

I also just found you can create one on the Google Chart API using this:

https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl=geo:30.3,-97.6

That creates me a QR code that looks like this:

enter image description here

So far, so good. And when I read that back on my iPhone using the QR Code Reader app, it sends me to a Google map in the correct location (Austin, TX).

The thing is, the string used to create this uses lat/long. If I wrote the same data to a KML file it would expect long/lat.

So the question is, what spec do I use for QR codes:

  1. Is the QR spec actually lat/long?
  2. Is the Google Chart API getting it mixed up?
  3. Is the QR reader app getting it wrong?

My money is on the QR reader messing up - but I'm not sure. Does anyone have a definitive answer?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

If it works, then I'm not sure how anything can be messed up! But I think I know what you mean.

The main issue is that QR encodes text, and that's it. How an application interprets that text is the key. The ZXing API for Android briefly lists "Geographic information" encoding as lat/long, and this is confirmed when I scan the QR you provided - it takes me to Austin, Texas.

I've poked around a little (but not exhaustively) and I can find no documentation on it apart from the link above - all other results ultimately lead to that page. A bit more searching may turn up a mailing list or forum discussion where the original spec was discussed.

So the upshot is, as far as geo QR codes go, lat/long is the "standard" and I would be surprised if it ever changed from that in the future. I could envisage another encoding using a different tag that was long/lat, indeed it's flexible enough for you to develop it for your application, but you'd really have to make people aware of it if you want other applications to use it.

Here's a Google Chart QR code with an example of a long/lat encoding, note the lonlat tag is one of my own invention:

https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl=lonlat:-97.6,30.3

enter image description here

As expected, my Android phone recognises it as a URI, but doesn't know what to do with it.

share|improve this answer
    
Thanks. I guess the question boiled down to: is Lat/Long the standard for QR? I just didn't trust the QR reader I have and wanted some sort of confirmation. Seems you have answered that for me. –  Mark Ireland Jul 5 '11 at 15:20
add comment

For Google Maps the URL can be parsed using maps.google

enter image description here

http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=H&chl=http%3A%2F%2Fmaps.google.com%2Fmaps%3Fq%3Dnyc%26hl%3Den%26sll%3D37.0625%2C-95.677068%26sspn%3D43.172547%2C93.076172%26z%3D11

Adding KML

For KML is has is be public and read through Google Servers for validation to generate the QR code.

http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=H&chl=http%3A%2F%2Fmaps.google.com%2Fmaps%3Fq%3Dhttp%3A%252F%252Fwww.nycbikemaps.com%252Ffiles%252FNYC_BICYCLE_MAP.kml%26hl%3Den%26z%3D10

enter image description here

Created using the new Chart Wizard

http://code.google.com/apis/chart/image/docs/chart_wizard.html

share|improve this answer
    
Wow. That wasn't really what I was asking, but that's very interesting and something I hadn't thought about. Thanks! –  Mark Ireland Jul 5 '11 at 15:22
add comment

Using ZXing Generator where you choose the Lat, Long or click the map, I see the same result on the chart API: http://chart.apis.google.com/chart?cht=qr&chs=230x230&chl=geo%3A63.27812271092345%2C18.709716796875 according to the ZXing wiki Geographic information:

For example, to encode the Google's New York office, which is at 40.71872 deg N latitude, 73.98905 deg W longitude, at a point 100 meters above the office, one would encode "geo:40.71872,-73.98905,100".

share|improve this answer
    
Useful generator. fyi the one I was also looking at was: mobilefish.com/services/qrcode/qrcode.php –  Mark Ireland Jul 5 '11 at 15:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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