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 \
liblua5.2-dev

cd ~/src
git clone git://github.com/openstreetmap/osm2pgsql.git
cd osm2pgsql
mkdir build && cd build
cmake ..
make
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

wget http://data.gis-lab.info/osm_dump/dump/latest/RU-BU.osm.pbf

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

/etc/mapnik/tools/update_lowzoom.sh
/etc/mapnik/tools/update_saddles.sh

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 http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.tgz 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
wget http://be.gis-lab.info/data/osm_dump/dump/RU-BU/RU-BU-170224.osm.pbf
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