Treasure thy maps
According to Greek myth, when Theseus went to defeat the Minotaur in Crete, he was able to find his way out of the labyrinth by laying and then following a thread he was given by Ariadne, a Cretan princess. Whilst laying a GPS breadcrumb trail on bike rides, later to be converted into a map, I like to think of myself as a latter-day Ariadne. Okay, that's a bit dramatic, but the OpenStreetMap project has an even loftier aim: to produce a database of map data for the entire world, released under a free license and serviced by a burgeoning range of APIs and tools.
Of course every reader of this magazine has probably visited an online map web site like Multimap, Streetmap or Google Maps at some point in their life. A city household isn't complete without an A-Z, and every self-respecting rambler will have a collection of Ordinance Survey maps tucked safely away with her garters and whistle. So you might ask, why does OpenStreetMap bother?
There are two reasons that will be familiar to you: copyright and fun.
Geographical data isn't Free in most countries, with government agencies and companies taking out copyright on their work then selling it back in various forms such as OS maps and route planners. Whilst these tools are usually sufficient for your average citizen, it's a breach of copyright to (for example) scan in an OS map and add waypoints, then upload that to your rambling club web site. For years I've wanted to make maps showing nice cycle routes out of Reading, and ethical places in the town centre, but I'm unable because the data is copyrighted.
To solve this, OpenStreetMap releases its data under the Creative Commons Attribution-ShareAlike license, which means you can happily use their maps so long as you say where they came from and share any derived maps under the same free license.
The knock on effect of this is that, since the data is open, there's nothing stopping people from producing interesting tools such as map renderers, route planners and goodness knows what else. Imagine an application plotting the optimum pub crawl route, taking into account hills, the quality and location of pubs and even reasonable takeaways en-route. Just like the Debian archives, OpenStreetMap could become a reflection of our weird and wonderful human nature.
For amateur cartographers like me, and the cottage industry that supplies custom maps to businesses and communities, OpenStreetMap is potentially a wonderful resource.
The second reason for OpenStreetMap is fun: lots of people find the activity really enjoyable, and I must admit that it becomes scarily addictive after a while. It's also fascinating learning every road and amenity in considerable detail; I'd usually walk around relatively unaware of my surroundings, but now I feel like a mastermind taxi driver.
So how does it work? There are three steps to making a map. First you gather a raw GPS trace of an area, which you upload to OpenStreetMap. Then you draw over the trace to produce the OpenStreetMap data. Finally you can render this using a number of tools to produce (hopefully) attractive and functional maps.
On your own it can be quite a laborious task. Mapping weekends, where a group of people get together to "do" a town or rural area, are a great introduction to the project and the techniques required. My first real mapping expedition was on a weekend I organised in Reading, which I'll use to explain the process of mapping. Unfortunately, given the pace of change in the project, precise details may be obselete by the time this article is published!
|
First, you need to go for a trip with a GPS unit, which works out your position from satellites and then leaves a "breadcrumb trail" of dots, usually one per second, as you move along a road or path. Figure 1 shows the combined traces from the Reading mapping weekend. Each continuous block of colour is a different trip, which averaged around 25km of cycling or walking.
As you go you need to note down the names of roads, either on a notepad, into a dictaphone or by taking photos. You can't use any data from copyrighted maps because they actually insert deliberate errors to catch plagiarists (why else would you have given the road the same inaccurate name as us?) If you have the time you can also create nodes for amenities like pubs, churches, phone booths, postboxes and so on, noting down their details as you go. For large areas like Reading it's a good idea to zone it off into cells by driving or cycling down all the main roads first. Each cell can then be done in a few hours, and you'll always know you've reached the edge of your cell when you hit a main road. You can see in figure 1 that some cells (in the South East) were left undone. |
|
Once home you upload this data to the OpenStreetMap web site, then start an editor. At the time of writing you can use the web site's Java applet, or standalone editors JOSM (which requires the proprietary Sun Java runtime environment) and osmeditor2. Then begins the boring part - interpret the traces and start drawing in the data. Nodes (dots) connect up to produce segments (lines), which in turn are collected into ways representing roads, footpaths, etc. Each way and some nodes can have metadata for names, types (e.g. primary, secondary and residential roads) and so on. Nodes can also stand alone to represent the amenities mentioned above.
All of these map features are described on the OpenStreetMap wiki, and anyone can propose a new feature, which becomes subject to a vote if nobody seems to hate it. Since the database is completely open, there's nothing stopping you from adding all kinds of crazy data. For example I've considered entering places where you can get free food (unattended apple trees, blackberry brambles, etc.) Slowly but surely you build up an increasingly complete picture of the area you just cycled around. You can see what a typical town centre looks like to the left - it takes a lot of work to make sure every one-way road, pedestrianised area and turn restriction is represented! |
|
Finally you get to the pretty phase, which is producing a nice render of the data. Osmarender is the leading tool for the job, and produces eye-pleasing SVGs that are easy to tweak and configure. Figures 3 and 4 show the output of Osmarender for Reading at the time of writing. Most of that data was gathered on the mapping weekend, and by myself in the two weeks since.
For each step alternative tools exist, and hopefully by the time you're reading this developers will have made leaps and bounds to make the process even easier and more powerful. |
The project is still young, with rapidly changing tools and APIs. But a surprising amount of data has been gathered, with regular mapping weekends filling in large areas of towns and rural areas. Last summer a team covered the whole of the Isle of Wight, and there are plans to map Rutland County, being the smallest in the UK with no major towns or cities.
Data for the whole of the USA is slowly being imported from the US Government's TIGER database. They stand out as a major exception to the copyright crowd by releasing all of their mapping data into the public domain, a requirement of their laws. So a script is importing it all into OpenStreetMap bit by bit.
OpenStreetMap is also partnering with related projects, such as Free the Postcode, which is trying to build a comprehensive, free database of postcodes and their latitude/longitude coordinates. It's no surprise that the Royal Mail jealously guard their database.
Some hope that in time organisations like Ordanance Survey and the Royal Mail will see sense and release all of their data into the public domain, like the US Government. OS are certainly aware of OpenStreetMap, which is gaining a lot of exposure at cartographer meetings around the UK, and there has been dialogue between OS and OpenStreetMap volunteers. If they don't, then we will just have to produce a completely free alteranative. It's the GNU Project cloning UNIX all over again.
If you're interested in maps, or you're a programmer interested in improving the tools and APIs, there's no better time to get involved. The lovely thing about OpenStreetMap is that absolutely anybody can join in; no special skills are required, unlike most free software and free culture projects. If you can move around with a GPS unit (on mapping weekends you can usually borrow one) or sit at a coputer drawing the maps you're a potential Freedom Cartographer!
This article was published in issue 67 of Linux User & Developer.