QR Codes

Thursday, December 30, 2010

QR Codes are one of those technologies, if you haven’t heard of them, that you’ve probably already come across. And like most things that gradually become pervasive, you realise they’ve been around for a long time. QR Codes are simply 2D barcodes. Rather than scanning a line and extracting a short series of digits, you image a 2D array and extract (more) data. Of course the reason most people aren’t particularly concerned with barcodes is that they don’t have a barcode reader, but regularly see them in use at the supermarket. It’s also not much use either…. you don’t have a backend database matching the barcode so it’s use is limited. However the explosion in the availability of smartphones and inclusion of a camera means that large swathes of the population now have a 1D and 2D barcode reader in their pocket.

The QRCode was created by Denso-Wave way back in 1994; of course you’d have needed a dedicated reader for it back then and whilst its use appears to be far wider in Japan it has been more limited elsewhere. That is all changing simply because by moving to 2D….. you can store more data!! Not surprisingly the (ISO) specification allows codes of different sizes. The larger the code the greater the capacity. And clearly you can encode anything you to from plain numbers and characters to XML data such as vCards and URIs. As a result there has been rapid take-up by the marketing industry: stick a QRCode on an advert, put in it a URL to a website with a special offer and you have a great campaign for instant interaction.

So how do you create QRCodes? Well the standard is open and, as a result, there are a plethora of online services. There is a nice roundup of sites here, including a stand-alone encode/decoder for Windows. Perhaps more useful for online QRCodes is dynamic generation via the API for Google Charts. This website is a service which generates the QRCode and also shows you the code to paste in to your webpage (in an IMG tag). The power here is that the “message” itself can be replaced with dynamic code as I’ve done on the template for the pages in this blog. So the QRCode below is dynamically generated for the URL of this unique page.

One might argue there is less use in putting it on a blog because a reader can simply use copy/paste from the address bar of the browser. It’s the print world where it is powerful (let’s face it, who wants to write down a 50 character URL!). I am involved in typesetting at the Journal of Maps and we use LaTeX. And, yes…. someone has written a barcode generation package that includes QRCodes. Again we can dynamically enter the DOI for the article and have it automatically generated at document creation time. The code is so simple its unbelievable really:

\imagetop{\begin{pspicture}(30mm,30mm) \psbarcode{http://dx.doi.org/\dx}{}{qrcode}

This article shows how to use LaTeX to create a business card the embeds a QRCode vCard. If you scan this with your phone it will offer to add it to your contacts automatically; now that really is useful.

The opportunities really do start to open up…400 characters for a 57×57 QRCode is a significant amount of data. You can put paragraphs of text in or entire XML encodings. For neogeography you could run a geocaching quiz that encodes the next destination in the QRCode; encode in a Google Map URL and it will show you where to go. Remember, you don’t need a GPS for this, simply get the code and move on. Which means if GPSs aren’t pervasive then liberally spread out QRCodes could operate as spatial identifiers. For organisations you could have asset tagging where its not only the ID for the object, but the metadata about it as well. I’m sure there are 1000s more applications, so keep an eye out for them!

Add comment

Fill out the form below to add your own comments