Local Tile Server Setup

Created by: Lester Caine, Last modification: 09 Aug 2015 (12:32 BST)

This was the crib sheet from 2013 and has been superseded by Local Tile Server Setup Take 2

The local version of the OSM map server is restricted to the British Isles based on the extracts served up by Geofabrik. This uses the .pbf file from the Britsh Isles Page.
Current build is time stamp 2013-07-09T18:59:05Z

Build state.txt via http://toolserver.org/~mazder/replicate-sequences/
---
---
 

The server is running a text mode install of SUSE12.3 with the latest Apache 2.4 and PHP5.4 along with Firebird 2.5 but augmented by Postgres 9.2 to allow the extraction of the data using osm2pgsql program.

All of the required packages other than the code distribution development files can be found in the openSUSE repository 'Geo' section.
http://download.opensuse.org/repositories/Application:/Geo/openSUSE_12.3/
The lis of packages to install has not been notted, so I need to establish exactly which ones are bring used.

osmosis
osm2pgsql
mapnik
mapnik-devel
postgresql92
postgresql-contrib
postgis2
python 2.7 normally already installed for mercurial
git
sunversion

zypper install python git subversion ( just confirmes installed )
zypper install postgresql92 postgresql-devel postgresql-contrib postgis2 ( Firebird is default database normally )
zypper mapnik mapnik-devel gdal osm2pgsql
zypper osmosis

Working in reverse order of the crib sheets used to set this up, which need combining into one crib sheet.

  1. http://wiki.openstreetmap.org/wiki/Minutely_Mapnik
  2. http://wiki.openstreetmap.org/wiki/Osmosis
  3. http://wiki.openstreetmap.org/wiki/PostGIS/Installation
  4. http://wiki.openstreetmap.org/wiki/Osm2pgsql
  5. https://github.com/mapnik/mapnik/wiki/OpenSuseInstallation
  6. http://weait.com/content/build-your-own-openstreetmap-server-lucid
  7. http://project-osrm.org/

Need to sort out a clean directory structure for this ...

cd && mkdir tileserver && cd tileserver
git clone git://github.com/openstreetmap/mapnik-stylesheets.git
cd mapnik-stylesheets
./coastlines.sh
start postgres
sudo su -c "createuser --superuser gisuser" postgres
sudo su -c "createdb -E UTF8 -O gisuser gis" postgres
sudo su -c "createlang plpgsql gis" postgres
echo "ALTER USER gisuser WITH PASSWORD 'something';" | psql -d gis
psql -d gis -f /usr/share/postgresql92/contrib/postgis-2.0/postgis.sql
psql -d gis -f /usr/share/osm2pgsql/900913.sql
echo <span class="st0">&quot;ALTER TABLE geometry_columns OWNER TO gisuser; ALTER TABLE spatial_ref_sys OWNER TO gisuser;&quot; | psql -d gis
osm2pgsql --bbox -14.5,49,3,61 --slim great_britain.osm.pbf

./generate_xml.py  --accept-none --dbname gis --symbols ./symbols/ --world_boundaries ./world_boundaries/
MAPNIK_MAP_FILE=&quot;osm.xml&quot; MAPNIK_TILE_DIR=&quot;tiles/&quot; ./generate_tiles.py

export WORKDIR_OSM=$HOME/.osmosis
mkdir $WORKDIR_OSM
osmosis --read-replication-interval-init workingDirectory=$WORKDIR_OSM
osmosis --read-replication-interval workingDirectory=$WORKDIR_OSM --simplify-change --write-xml-change changes.osc.gz
osm2pgsql --bbox -14.5,49,3,61 --append --slim changes6.osc.gz
</span>