» next  » last 

Jump to:


Open Source Maps - Data and Software

Since we did the Long Walk last Summer I have been very interested in open source mapping tools. I had really wanted to plot our progress along the South West Coast Path by uploading coordinates from a friend's GPS unit each night. With the Grand tour of the USA coming up this September my interest has been renewed.

My initial research had lead me to believe that map data is very very expensive. On the face of it, I thought I'd have to spend thousands of pounds in order to plot anything like a decent map of the Devon coastline, let alone the whole of North America or the entire World. To add to the financial pain, most suppliers of map data charge an annual licence fee, rather than a one-off payment. This means that only those who are planning to make large sums of money are going to be able to justify the cost.

Searching around on the internet for things like "free map data" didn't really yeald much either. The world is full of people trying to sell things, and all of those have higher search engine rankings than the people who are trying to do things for free. In the end I found what I was looking for, though - otherwise there wouldn't be any point writing an article.

Route of the
Figure 1: Route of the "Long Walk" 2004 - Sadly I didn't get chance to use the GPS output


It turns out that the best source of free map data, contrary to what you might expect, is the CIA. They have released the vmap0 dataset, which covers the entire world and contains a huge number of layers including everything from coastlines to power stations, populated areas, oil wells, vegitation and roads. The vmap0 data is available totally free (I downloaded it from Map Ability), in fact the only cost imposed on the user is the headache of dealing with the antiquated file format and strange naming conventions used.

Vmap0 is a vector dataset, so all features are represented as points, lines or polygons (areas). The only glaring omission from the vmap0 dataset is height data. Typically, height data is provided in a raster format - a grid of integer values in which each value represents the height of an area above sea level. Since vmap0 is vector based its not too much of a shock that height data isn't included. The US National Geophysical Data Center (NGDC) has released a raster height dataset called ETOPO2 which can be downloaded free and provides raster height data with a resolution of 2 arc minutes. GTOPO30, developed by the US Geological Survey, NASA and others, has a much higher resolution of 30 arc seconds (around 1km). Both of these datasets are available for free download from the internet.

Using these datasets alone I was able to create some reasonably impressive maps which have a global scope and cost me nothing other than some extra RAM for my Linux server and a reasonable chunk of my time this spring.

Yosemite National Park in California, USA
Figure 2: Yosemite National Park in California, USA


The software I used to create the mapping system is called "Map Server". I think (judging by several confusing search results) there are several products called "Map Server", so to avoid confusion, I am using the open source one, originally developed at The University of Minnesota. The software runs under a Windows or Linux web server as a CGI application or a PHP module. Since I have a Linux Server (Clive) sitting in my study on a 24x7 internet connection it seemed sensible for me to use the Linux version. As most of my web page is coded in PHP I chose the PHP module over the CGI.

Before I get on with the remainder of the article, I think I should probably mention some of the requirements for a mapping project such as this one. The data directory on my server is now close to 5Gb, which mapserver must trawl through every time it produces a map. Clive the server is probably below the lowest required specification but manages to create maps like the ones above in less than 30 seconds.
  • CPU: Athlon (original) 700MHz
  • 768Mb (upgraded for this project)
  • Disk: Minimum 5Gb
  • OS: Fedora Core 2
  • Software: Apache, MySQL, C/C++ Compiler


Machines of around that spec will be good for development and single user projects, but if you want to develop a serious application which will generate maps quickly or be used by many people at the same time then you're going to have to throw something a lot quicker at it.

The remainder of this article gives more details of the vector and raster datasets I've used to create my map system, a very technical section on the installation of mapserver and the associated tools for dealing with the data, a page of information on how to convert vmap0 data to a sensible format and a quick tour of the user interface I developed in PHP.

As always, I'd be very interested in any feedback you have to offer on what I've written here. dan@logicalgenetics.com is my mail address.

» next  » last 

Jump to: