Benchmarking 2011/Imposm

From OSGeo
Jump to navigation Jump to search


Installation of imposm with all dependencies on the linux_db_bm host.

Installation steps

Install everything inside `/opt/imposm`:

cd /opt/
mkdir imposm
sudo mkdir imposm
sudo chown myusername:wms imposm

Install a recent >2.4 Python version:

cd /opt/imposm/
mkdir src
cd /opt/imposm/src
tar xf Python-2.7.1.tgz 
cd Python-2.7.1
./configure --prefix /opt/imposm
make -j2
make install

Install google-protobuf for PBF format:

cd /opt/imposm/src
tar xf protobuf-2.4.1.tar.bz2 
cd protobuf-2.4.1
./configure --prefix /opt/imposm
make -j2
make install

Install tokyocabinet for internal import cache:

cd /opt/imposm/src
sudo yum install bzip2-devel
tar xf tokyocabinet-1.4.47.tar.gz 
cd tokyocabinet-1.4.47
./configure --enable-off64 --prefix /opt/imposm
make -j2
make install

Install distribute/pip to install Python packages:

cd /opt/imposm/src
../bin/easy_install pip

Install Imposm:

cd /opt/imposm/src
export CFLAGS=-I/opt/imposm/include
export LDFLAGS=-L/opt/imposm/lib
export PATH=/opt/imposm/bin:$PATH
pip install imposm

To install the "trunk" version change the last line from above with:

pip install


Creating the database:

sudo su postgres
createdb -E UTF8 osm
createlang plpgsql osm
psql -d osm -f /usr/share/pgsql/contrib/postgis-1.5/postgis.sql
psql -d osm -f /usr/share/pgsql/contrib/postgis-1.5/spatial_ref_sys.sql

Download OSM extract:

cd /opt/imposm
mkdir osm_data
cd osm_data

Run Imposm:

export LD_LIBRARY_PATH=/opt/imposm/lib
imposm --read colorado.osm.pbf --write --optimize --deploy-production-tables -d osm --user postgres --overwrite-cache --proj epsg:3857

The --optimize option calls VACUUM ANALYZE on all tables. Autovacuum can be disabled in PostgreSQL (and is).

And that's it: