[OSM-dev] 'One-pot' Mapnik generation code

Nick Whitelegg nick at hogweed.org
Tue Jan 9 23:40:24 GMT 2007

Have done a very, very rough first attempt at a 'one pot' application to grab 
data from the live OSM database, and, via shapefiles, render as a Mapnik 
image. At the moment it only does the following:

- takes a username,password, and bottom left lat and lon from the command line
- grabs a tile from OSM of dimensions 5.12 x 5.12 km, projected in OSGB (will 
become Mercator - thanks Chris)
- generates shapefile of the ways in this data
- renders a map in Mapnik.

The intention is to allow users to specify a much wider range of parameters 
(bounding box, Mapnik XML file, resolution, etc) and download and render OSM 
data in tiles - and eventually to turn this into a tiles at home type approach 
for Mapnik. 

I'm developing this mostly for generating Freemap maps (walkers' maps of OSM 
data) but it has potential applicability for any type of OSM rendering. It's 
in C++ (something like Perl would probably be the natural choice, but I know 
Perl less well than c++, also I'd like to eventually give Windows users the 
opportunity to render maps with .exe point and click simplicity).

Code is http://nick.dev.openstreetmap.org/mapnik2/fmapgen.cpp. Any feedback on 
the way I'm doing this (and any improvements) would be welcome...


More information about the dev mailing list