[OSM-dev] running a local server

Keith Sharp kms at passback.co.uk
Fri Nov 2 10:22:59 GMT 2007


On Fri, 2007-11-02 at 09:08 +0000, graham wrote:
> My server is on debian, so I won't use yum directly. But the general 
> idea looks like :
> 
> - convert planet to postgresql using osm2pgsql
> - use mapnik to render data from the db on the fly
> - use tilecache to reduce the load on mapnik
> 
> So what is the actual server software that interprets the api calls
> to 
> pass to mapnik? Or is that considered trivial/a one-off to write for 
> each new application? 

The hierarchy as I understand it:

1) Openlayers JavaScript executes in users browser and makes HTTP
requests for tiles.

2) HTTP requests for tiles are received by Apache HTTPD and passed to
TileCache which executes using mod_python.

3) TileCache determines if it already has a rendered tile and if so
returns that tile in response to the HTTP request in (1).

4) If no tile exists TileCache invokes Mapnik to render a tile.

5) Mapnik uses the osm.xml file to obtain data from the Postgres/PostGIS
database.  The osm.xml file also contains presentation/style information
such as road colours and widths, icons for map features etc.

6) Mapnik renders a tile based on the combination of the information in
(5) and passes this tile back to TileCache.

7) TileCache writes this tile to disk for reuse in future requests and
then returns the tile in response to the HTTP request in (1).

8) OpenLayers uses the browser to render the tile on the users screen as
a map.

9) The user does something in the map (eg pans or zooms) and the whole
process starts again.

The only code you should have to write is the HTML/JavaScript to create
the user interface that will be presented in the web browser of the
end-user.  In terms of setting up the backend bits and pieces all you
need to do is edit the appropriate configuration files.

You can look at the raw config files for my Fedora slippy map setup in
my subversion server:

http://www.passback.org.uk/svn/maps/osm-slippymap/trunk/

This directory contains the config for TileCache and for running
TileCache in Apache.  It also contains the osm.xml file for configuring
Mapnik, and HTML/Javascript for a simple slippy map.

Keith.






More information about the dev mailing list