[OSM-dev] Availability of slippy map during LinuxTag 2007

Jon Burgess jburgess777 at googlemail.com
Mon May 28 19:24:20 BST 2007


On Mon, 2007-05-28 at 18:29 +0100, Jon Burgess wrote:
> On Mon, 2007-05-28 at 18:37 +0200, Joerg Ostertag (OSM Munich/Germany)
> wrote:
> 
> > > Alternatively you could setup your own local tile server. It isn't too
> > > hard to setup osm2pgsql/mapnik with either a rails server or tilecache.
> > > I have these setup on my home PC and can give some hints if you get
> > > stuck.
> > 
> > Sounds good. can you send me the hints on how to do it. Then I would try to 
> > install it on the Notebook which we take to the Linux Tag tomorrow morning.
> > 
> > -
> 
> I think that using tilecache is the easiest and fastest way to render an
> OSM based map on your machine. Below are the steps I used on my Fedora
> machine, the file paths etc may be different in your setup.
> 
> There are dozens of steps where things can fall down. I can not give
> complete details to cover every possible problem. The best thing is to
> have a go and let me know if you get stuck.
> 
> You might want to start the 2 big downloads steps 13/14 first.
> 
> 1) Download latest planet.bz2 file from http://planet.openstreetmap.org
> (the .7z can also be used if you have 7za installed).
> 
> 2) Download the 600MB shapefiles from
> http://artem.dev.openstreetmap.org/files/world_boundaries.tar.bz2 
> - you might already have a copy of these look for world_boundaries_m.shp
> on your machine, there should be 26 files in total.
> 
> 3) Install and run a web server on localhost
> 
> 4) Place the attached tilecache.html file in your web root.
> 
> 5) Make a /javascript directory in the web root and download the
> OpenLayers.js into it:
> $ wget -O OpenLayers23.js http://openlayers.org/api/2.3/OpenLayers.js
> 
> 6) Download http://www.tilecache.org/tilecache-1.8.1.tar.gz 
> 
> 7) mkdir  /var/www/wms-c and unpack the tilecache files into it
> 
> 8) Place tilecache.conf in /etc/httpd/conf.d
> 
> 9) Make sure you have mod_python installed (tilecache can run via CGI
> but this is quite a bit slower).
> 
> 10) Place the attached tilecache.cfg in /var/www/wms-c/tilecache.cfg
> 
> 11) Check out the OSM svn tree (I use ~/osm/svn.openstreetmap.org)
> 
> Next we need mapnik, osm2pgsql, postgres & postgis setup. Details are at
> http://wiki.openstreetmap.org/index.php/Mapnik . I've also listed them
> separately below:
> 
> 12) Compile mapnik (it should be part of the svn tree at
> ~/osm/svn.openstreetmap.org/applications/rendering/mapnik/mapnik.org
> 
> 13) Compile osm2pgsql from
> ~/osm/svn.openstreetmap.org/applications/utils/export/osm2pgsql/
> See the readme.txt for further help
> 
> 14) copy osm2pgsql to ~/bin
> 
> 15) Make sure you have postgres installed with a database called 'gis'
> which has had the postgis extensions added (see the wiki page).
> 
> 16) run osm2pgsql to import the planet file:
> $ osm2pgsql ~/osm/planet/planet-070516.osm.bz2
> or
> $ 7za x -so ~/osm/planet/planet-070516.osm.7z | osm2pgsql
> 
> This should take around 10 - 30 minutes to import the planet file
> depending on your hardware.
> 
> 17) Update
> ~/osm/svn.openstreetmap.org/applications/rendering/mapnik/osm.xml with
> your local file paths and Postgres connection parameters. I use the
> convert script in that directory to make the changes:
> $ ./convert osm.xml > osm-jb-merc.xml
> 
> 18) Update the mapfile= line in /var/www/wms-c/tilecache.cfg to point to
> your modified osm.xml file.
> 
> Restart web server. Cross fingers. Point web browser at
> http://localhost/tilecache.html
> 
> If it fails, first check the apache error log. On Fedora I needed to
> turn off the selinux protection to allow a the tilecache script to open
> a socket to connect to the DB (setenforce 0).
> 
> 	Jon
> 

The attachments were a little too large to get to the mailing list. I've
placed them at:

http://www.jburgess.uklinux.net/tilecache.html
http://www.jburgess.uklinux.net/tilecache.conf
http://www.jburgess.uklinux.net/tilecache.cfg

	Jon






More information about the dev mailing list