Skip to main content

Open allotments

Here at ODI Leeds we're working on an Urban Commons project along with Leeds City Lab and others. As part of that we've been looking into open data sets about land use.

As it is National Allotment Week, and to get the ball rolling, I started by looking at two small data sets on Data Mill North: Leeds City Council managed allotments and association managed allotments in Leeds. These data sets contain the name, postal address, information about the number of plots, and the facilities for each allotment owned by the council. Unfortunately, the useable geographic information is limited to the postcode. Our urban mapping project needs to work with a map so a postcode, by itself, doesn't quite do the job. However, we can attempt to determine the location/shape/size of the allotment (which the council knows but can't share because that information belongs to Ordnance Survey) using open data sets.

Finding location

First we can use the ONS Postcode Directory to find approximate longitudes and latitudes for each allotment's postcode. We can do better than that with open mapping data from Open Street Map (OSM). First I plotted all the postcode locations on top of an OSM map. For each allotment I had to identify if it existed on Open Street Map or not. As I wanted to be able to tie Open Street Map's geography together with our council data sets I needed a way to do that. The Leeds City Council data set had no unique IDs so the only identifying field was the name. I decided to use this as the common key. For each allotment I checked Open Street Map to see if it had the allotment drawn and, if it did, made sure it was named correctly (if it wasn't I renamed it on Open Street Map). If the allotment didn't exist I used the Open Street Map editor to draw it (if it was visible on the satellite imagery) or, in one case, walked around the perimeter of it with my Garmin GPS device and used that track to add it to the map.

Allotment map of Leeds
A map showing where allotments are in Leeds. Green leaves are allotments included in Open Street Map. Red leaves are rough locations of Leeds City Council allotments based on their postcodes. The aim was to match every red leaf with a green one.

This process has been fairly manual and there are still a handful of allotments (out of 99) that I haven't been able to identify. It wasn't a waste of time though as it added several missing allotments to the map and made sure many others were named. Doing this has improved the underlying map for anyone else who wants to use it in the future.

Next up was Calderdale Council's data set. After a very useful conversation at the July Data Drop-In, here at ODI Leeds, Calderdale Data Works kindly provided a GeoJSON file of their allotments. This provided the locations (and shapes) of the allotments. Using the locations, I checked to see which of Open Street Map's allotments were missing names and, if so, add them. In a few cases I used Open Street Maps' editor to draw allotments it was missing. I had to trace them from the satellite imagery provided in OSM's editor rather than use the shapes from Calderdales' file as those were copyright to Ordnance Survey. Having done the base work for the Leeds data set, this was much quicker.

Allotment map of Leeds
West Yorkshire allotments on a custom map

Towards a common format

The result of all this effort is that I can now automatically process the Data Mill/Works data sets and match allotments with polygons from Open Street Maps. This means I can add open geographic information to the council data sets and create a more useful, richer, combined result.

There is quite a bit of variety in the fields provided by the two councils and, ideally, we would get all of West Yorkshire's councils to agree on a common format for their open allotment data. For instance, it would be great to know who to contact for each allotment. With a shared format, we could build some useful tools on top of the data. To that end, Grow Bradford have volunteered to add Bradford's allotment names to Open Street Map. That means that if Bradford MDC can be persuaded to add their allotment data to Data Mill North, it'll be fairly easy to ingest.

Making a map

To show the results I've used the Leaflet Javascript library to combine the data from Data Mill North and Calderdale Data Works with allotment polygons extracted from the Open Street Map data for West Yorkshire provided by GeoFabrik. I've investigated making our own map tile set but, for now, the greyscale one from Stamen Design fits the ODI brand colours. The visualisation is still developing but, for now, you can explore the current state of our west yorkshire allotment map.

Allotment map of West Yorkshire
The West Yorkshire Allotment map

Update: 2016-08-12

Things have progressed quickly during National Allotment Week. As of yesterday afternoon, thanks to Yunus and Mohammad at Bradford Metropolitan Borough Council, Bradford's allotments are an open data set on Data Mill North. That means Leeds, Bradford and Calderdale now publish their data (albeit in different formats). I also found that Kirklees have a kml file of their allotments so have used that to help identify missing allotments in their area. I've added pins to the map which show allotments in council data sets that aren't on the map. Clicking on a pin gives the name of the allotment and a handy link to help draw it on the map. This should make updating Open Street Map much easier.

The next steps would be to get Kirklees and Wakefield councils to publish their data on Data Mill North and, ideally, for the five councils to agree a common format to use for publishing this data. Other councils around the country could then use that as their template too.

  • Leeds Love It Share It
  • University of Leeds logo