Archive for the ‘Web’ Category
Code-Point Open – Northern Ireland Addendum
In April 2010 Ordnance Survey released The Code-Point Open dataset under a licence compatible with the Creative Commons Attribution Licence. The dataset locates, by OSGB grid reference every postcode unit in England, Scotland and Wales. Northern Ireland is missing. You can read more about the limitations of the Code-Point Open dataset in my previous post
All [...]
The Problem With Code-Point Open From Ordnance Survey
Before I begin, let me just say that decision of Ordnance Survey to release a whole bunch of their data into the public domain is a massive leap in the right direction. The number of freely available datasets is vast, but what I’m most interested in is the Code-Point Open dataset.
Code-Point Open purports to [...]
Creating MySQL Dates From Integer day, month and year columns
Granted, this is hardly a common occurrence, but recently I’ve had need to work with a database table that for historical reasons stores dates in three separate integer columns, one each for day, month and year. The need for special intervention here depends very much on your data, and I’m assuming that if you’re reading [...]
Yoda Syntax – A Backwards Design Pattern for If Statements
Sometimes the penny drops and you realise there’s a childishly simple solution to a problem that’s been bugging you for years. And no, I’m not talking about my wife, I’m talking about Yoda Syntax.
Have you ever spent far too long hunting down an impossible bug in your PHP only to eventually track it down to [...]
Google Streetview Postcode Thumbnails
Following my explorations of Google’s undisclosed Street View Images API, I’ve put together a handy little webservice that mashes up postcode geodata with the Streetview Images API.
It’s handy in that it let’s you directly request a streetview thumbnail with nothing more than a postcode. The format of the request looks like this:
http://geo.jamiethompson.co.uk/streetview/[POSTCODE]_[WIDTH]x[HEIGHT].jpg
As far as the [...]
Expanding Short URLs with PHP: expand_url PHP function
URL shortening services work by redirecting a users browser from the shortened URL to the actual target URL. Some of these services provide means of reversing the shortening process. Some provide API methods for this.
The following function will take a shortened URL, from any service, and return the original URL. As it works by inspecting [...]
Create Short URLs with PHP: shorten_url PHP Function
Do you want to create short urls from within your own PHP application? Most url shortening services provide an API, it’s how apps like twitter clients provide built-in url shortening. I wrote a small PHP function to provide url shortening from two of the most popular services, is.gd and tinyurl.com. Where’s bit.ly I hear you [...]
Google Streetview Static API
It is possible to extract both thumbnails and higher resolution images (tiles) from the Google Streetview service through an unpublished, undocumented API which I will document below. Google have not publicly released this API, but nor have they sought to secure or even obfuscate it in any way. To me, this is about as open [...]
An Open Postcode Geocoding API
Because I needed one for various (non-profit) projects of my own, I’ve put together a small Postcode geocoding web service which collates partial data from various sources into what aims to be a full geocoder / reverse geocoder for UK postcodes.
Now, the term ‘geocoding’ can mean several very subtly different things depending on who you [...]
jQuery Document Meta Plugin
Got some persistent variables you want to pass from the server-side into your jQuery application? If you’ve got lots of complex data then you probably want to pull it in as JSON data, but for a handful of scalar variables it can be nice to just output them in the document head as meta tags.
<meta [...]

