Difference between revisions of "Benchmarking 2011/Imposm"
Jump to navigation
Jump to search
m |
|||
(8 intermediate revisions by one other user not shown) | |||
Line 58: | Line 58: | ||
export LDFLAGS=-L/opt/imposm/lib | export LDFLAGS=-L/opt/imposm/lib | ||
export PATH=/opt/imposm/bin:$PATH | export PATH=/opt/imposm/bin:$PATH | ||
− | + | pip install imposm | |
+ | |||
+ | To install the "trunk" version change the last line from above with: | ||
+ | |||
+ | pip install https://bitbucket.org/olt/imposm/get/default.tar.gz | ||
== Importing == | == Importing == | ||
+ | |||
+ | 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: | Download OSM extract: | ||
− | cd /opt/imposm | + | cd /opt/imposm |
mkdir osm_data | mkdir osm_data | ||
cd osm_data | cd osm_data | ||
Line 72: | Line 84: | ||
export LD_LIBRARY_PATH=/opt/imposm/lib | export LD_LIBRARY_PATH=/opt/imposm/lib | ||
− | imposm --read colorado.osm.pbf --write -d osm - | + | 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: | ||
+ | |||
+ | [[File:Imposm-db-denver.png]] | ||
+ | |||
+ | ---- | ||
+ | |||
+ | [[Category:Benchmarking]] |
Latest revision as of 05:33, 6 June 2012
Installation
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 wget http://python.org/ftp/python/2.7.1/Python-2.7.1.tgz 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 wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2 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 wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz 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 wget http://python-distribute.org/distribute_setup.py ../bin/python distribute_setup.py ../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 https://bitbucket.org/olt/imposm/get/default.tar.gz
Importing
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 wget http://download.geofabrik.de/osm/north-america/us/colorado.osm.pbf
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: