A listed buildings app for the iPhone

Mar 28, 2010 10:45 · 532 words · 3 minute read app hacking heritage iphone

English Heritage is a non-Departmental Public Body that exists to protect and promote England’s historic environment. One of the tools at their disposal is listing, which applies protection to a building or site through the planning system. Crudely, it stops you putting plastic double glazing into your historic thatched cottage; or demolishing a factory designed by that world-famous architect.

There are a lot of listed buildings - about 374,081 of them - and they’re listed in a database which English Heritage made available to the Rewired Culture event. It appears to have been a dump of some kind of GIS system - it’s in a dBase format and has eastings, northings and polygons for the structures. There’s no information about the buildings other than a name and a very truncated street address (there’s no town data, for example), but you can at least identify them geographically.

Job #1 is converting the eastings and northings to latitude and longitude. That’s painful maths, but a one-off process and thankfully doable through some PHP functions which someone else previously written.   So a quick PHP script runs the conversion on the fly to convert from the supplied lat/long to the eastings/northings needed to interrogate the database.

Job #2 is being able to find out where the listed buildings around you are. This is another web service with a PHP backend that accepts a pair of lat/lon coordinates and a radius, and spits back a list of lat/lon coordinates of the buildings within the radius together with their names and street address.

I managed to get that pair of services more-or-less working during the day after a fair amount of tweaking, which just left the front-end piece - you can access the webservice at listedbuildings.adoptioncurve.net - it should be fairly self-explanatory.

Job #3 was entirely due to needing something to do on the 2-hour train ride back to Sheffield. This is a simple iPhone client which pick up your location from GPS and pings the aforementioned web service to grab a list of buildings in the locale. It then plots them as pins on the map to show what’s around you.

Because the resolution of the grid reference allows pretty accurate map placement, in theory it should be possible to go one step further and overlay the pins onto an augmented reality-style display. The idea would be to whip out your iPhone / Android device, point in the direction of the building in front of you and know at a glance whether it was listed or not. Then with another level of access into the back-end data (which English Heritage don’t appear to offer though any kind of API, yet) you could easily display the information that they hold about the structure.

I’m going to continue to polish up the various rough edges over the next few days, and then post the results up. I haven’t dug into the data’s usage conditions enough to know whether it would be possible to offer an iPhone app via the App Store, but assuming there’s no roadblocks to this I might give it a go. And it’ll be available for anyone who wants to try it in a beta form.