Jump to content

PostgreSQL postgis

From annawiki

Example for Ubuntu and osmdb

apt install postgis
sudo -u postgres createuser osmuser
sudo -u postgres createdb --encoding=UTF8 --owner=osmuser osm
sudo -u postgres psql osm --command='CREATE EXTENSION postgis;'
psql -d osm
SELECT PostGIS_Version(); //verify install
quit;
apt install osm2pgsql //https://osm2pgsql.org/doc/install/linux.html
wget https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
osm2pgsql -d osm -s berlin-latest.osm.pbf //osm2pgsql took 302s (5m 2s) overall.