OpenEcoMaps is back!

OpenEcoMaps, eco-living maps using OpenStreetMap data, is now working again. Hooray! I decided to sit down and work out why the OpenLayers interface wasn’t working and it turned out to be quite simple to fix.

You can now browse around maps of low carbon energy generators in London, veggie restaurants in Edinburgh, allotments in Exeter, recycling facilities in Glasgow and more! The data is updated every hour, direct from OpenStreetMap, and is available on maps and downloadable/reusable KML and GeoJSON files. The code is also in Github, so you could set-up your own version for another country if you like.

OpenEcoMaps is back!

There are still some of the layers that aren’t working because the underlying data isn’t being extracted from OpenStreetMap properly. But I’m very glad that, after well over six months with it completely broken, the web site basically works again!

OpenEcoMaps halfway back

For almost a year now, my pet project OpenEcoMaps has been broken. The vagaries of unreliable XAPI servers meant the system couldn’t download OpenStreetMap data to create all the KML files, and (I think) some changes to OpenLayers meant the web maps also stopped working. It has taken me a long time to work up the energy to fix these.

Today I can happily say one half of the system is now working again, and the underlying code is much improved.

OpenEcoMaps halfway back

OpenEcoMaps KML files, and now GeoJSON files, are being created again. Hooray! I switched from XAPI to the Overpass API; grabbed JSON which enabled me to write a more powerful function to turn this into usable objects (for example building a complete Python object for an allotment merging data from relevant nodes, ways and relations); wrote a new library to create GeoJSON files; refactored everything else to fit with these changes; and made numerous other small improvements.

You can browse, download and use the KML files and GeoJSON files with those links. To see an example, look at this KML file of low/zero carbon energy generators overlaid on Google Maps.

Now I just need to fix the web maps so you can see the lovely features on the main web site, and so people can easily embed the maps on their own web sites. I did dabble with using Leaflet before Christmas but I got stuck trying to get the icons to match styles defined in the GeoJSON file. I had a quick look at the OpenLayers code and quickly decided I had better things to do with my time! If anyone fancies giving it a go, the code is all in Github and is all released under the General Public License.

Maps, open data and activism on the Heygate estate

Andy Allan’s excellent post on cycle campaigning reminded me to blog about some mapping help I’ve given a campaign group called the Elephant Amenity Network. One of their long-running issues has been the clearance and demolition of the unfairly maligned Heygate Estate, over 1000 council homes that should have been refurbished for council tenants instead of being knocked down for aspiring home owners to move into the area.

A photo of the Heygate Estate in Elephant & Castle, London

One of the best features of the Heygate Estate is the urban forest that has grown there in the past thirty or forty years. But the few remaining residents and local campaigners fear the “regeneration” will see many or even most of them cut down.

Through a friend who is involved with the campaign, I came along to help them map the trees that are there now. Knowing what you have seems like a good first step to saving it.

So I helped them enter the trees into OpenStreetMap using the OpenEcoMaps install of the Potlatch 2 editor, set-up a simple map that shows them as clickable objects on a map, and provided them with a spreadsheet of all the data at the end of the process.

Some other clever bods in the campaign then used a system called CAVAT (Capital Asset Value for Amenity Trees) that puts a financial value on the trees. They estimate the value to be well in excess of £7.6m! Here is the CAVAT valuation laid on top of OpenStreetMap:

I’m glad to say this has become a case study in a recent London Assembly report into the state of street trees in London, which makes recommendations about the need for open street tree data and uses this Heygate mapping to show both the demand for this data and how useful it can be.

Since mapping the trees ourselves, I’ve received a file with all the trees in Southwark from the council with permission to use and share it, which is brilliant. I did a test import in East Dulwich/Peckham Rye, but stopped short because of rendering issues. It would be great to be able to import the lot and see if citizens can keep the data more up to date than the council, or perhaps even collaborate with the council and Trees for Cities?

Announcing OpenEcoMaps to geeks

I’m happy to announce that OpenEcoMaps is now stable and ready for use, albeit with a few wrinkles that I hope some more able hackers can help me iron out. OpenEcoMaps takes data about “eco” (green / sustainable) features stored in OpenStreetMap and turns them into KML files that are shown as overlays on the map, making it easy for people to find out where they can get a vegetarian meal, forage some wild fruit, spot a solar panel, recycle a can, pick up a car club car, or spend some money in a cinema.

You can use these KML files on your own map, or in Google Earth; you can embed the OpenEcoMaps map in your own web site; or you can just browse around the site.

At the moment there are packs of overlays for London and Exeter, but I can quite easily add other local areas with any combination of the features. I can also add in new features, they’re just little chunks of Python code to specify how OpenStreetMap tags are interpreted. Leave a comment if you want something in your area – I need a bounding box, the title for the area, and a set of layers specifying the title for the layer and the features you want in it.

I’ve been waiting for a reliable XAPI service before launching, and thanks to Mapquest I’m now able to say – use and abuse it!

Most of the data was added by various OpenStreetMap mappers over the years, it’s really fun to pull out something you think is very niche and find how much we already have in the database. But I’ve also been sourcing open data from organisations like the GLA and Southwark Council, particularly for renewable energy installations and food growing spaces. What’s interesting is finding out just how little these public bodies actually know.

Over the summer I’ve got a few events with food organisations where I’m going to present the project following my work with the council, the GLA and Sustain. That will be a nice opportunity to see how usable the average citizen finds the web site, and how useful it really is to them.

There are still a few features I think it needs before announcing it to networks of local green groups like Transition Towns. So if you’re a geek interested in this project please have a look at the TODO list on github and get stuck in.

Growing pains & getting data out of OpenStreetMap

One of the killer features of OpenStreetMap, which makes it completely different to Google Maps and the rest, is that we provide totally free geodata. In fact it’s really the primary purpose of OpenStreetMap – the various maps shown on the homepage are just a tasty preview.

For those of us lacking the time, money and skills enjoyed by some of the cooler data users (i.e. unable to run a dedicated server with a PostgreSQL database and all the programs and storage space needed to maintain an up-to-date clone of the OpenStreetMap database) there are two main ways to grab OpenStreetMap data.

One is to simply download a defined area using the API. The “export” tab on the web site and editors like JOSM make this easy. The disadvantage is that you get everything in that area. If you wanted to get, say, all the power generators in the UK you would need to download and process gigabytes of data for the whole of the UK to pull them out.

Thankfully we have the wonderful eXtended API (XAPI, or “zappy”). This lets you define the features you want to download, and the area you want them for. So I can easily download a small file just containing power generators in the UK.

I have used XAPI for my OpenEcoMaps project. It’s great. It lets me build a web site on cheap shared hosting without needing ninja data processing skills. I love it.

Unfortunately, for the past few months XAPI has gradually become so overloaded that it is useless. I don’t think I have been able to make a batch of five calls for data from XAPI for weeks. OpenEcoMaps tries to download fresh data every hour, to no avail. Downloads either time out, return empty files, or return partial files that stop half-way through.

As a result I’ve not been able to launch OpenEcoMaps, and I’ve had to slow down conversations with local community groups, charities, councils and regional government about various exciting collaboration ideas.

I don’t begrudge hard-pressed volunteers who set XAPI up, especially when so much good work has gone into making the main web site, the default map, the wiki and the underlying database run so reliably.

But I wish and cross my fingers for the day when there is a resource – either from the community or a company – to run a reliable XAPI service. I’d even be willing to pay a small annual fee for access. In the meantime, sadly for me, the work I’ve been building up over the past few years networking with those other groups has ground to a halt because of my inability to get data out of OpenStreetMap. Suggestions are welcome.