OpenStreetMap logo OpenStreetMap

Sibri's Diary

Recent diary entries

Local OpenTopoMap

Posted by Sibri on 25 February 2017 in Russian (Русский).

Status: not yet full description
Last updated: 25.02.2017 17:26 GMT+03:00
OS: Ubuntu 16.04 LTS

Install database and append data

## 1. Install osm2pgsql full description

sudo apt-get install make cmake g++ libboost-dev libboost-system-dev \
libboost-filesystem-dev libexpat1-dev zlib1g-dev \
libbz2-dev libpq-dev libgeos-dev libgeos++-dev libproj-dev lua5.2 \

cd ~/src
git clone git://
cd osm2pgsql
mkdir build && cd build
cmake ..
sudo make install`

2. Drop old data

psql -d gis -c "DROP VIEW lowzoom_water, lowzoom_roads, lowzoom_landuse, lowzoom_borders, lowzoom_railways, lowzoom_cities;"

psql -d lowzoom -c "DROP TABLE water, landuse, roads, borders, railways, cities;"

3. Load data into database

mkdir data
cd data


osm2pgsql --create --slim -d gis -C 1000 --number-processes 10  \
--style /etc/mapnik/osm2pgsql/ ./data/RU-BU.osm.pbf


4. Run renderd

sudo renderd -f -c /etc/renderd.conf   #fixme sudo

To clear cache sudo rm -R /var/lib/mod_tile/default/ than press F5 in browser

Generate and append changeset

## 1. Install osmosis wget mkdir osmosis mv osmosis-latest.tgz osmosis cd osmosis tar xvfz osmosis-latest.tgz rm osmosis-latest.tgz chmod a+x bin/osmosis sudo ln -s /home/developer/osm_database_update/src/osmosis/bin/osmosis /usr/local/bin/

2. Generate changeset

cd data
osmosis --read-pbf file="RU-BU-170224.osm.pbf" --read-pbf file="RU-BU.osm.pbf" --derive-change --write-xml-change file="RU-BU-changeset-170224.osc" ## 3. Append changeset
osm2pgsql --slim --append -d gis RU-BU-changeset-170224.osc