Datenbank
PostgreSQL
Installation
sudo apt-get install postgresql-all
PosgreSQL Version zeigen
Postgis Installation in Ubuntu 23.04
sudo apt install postgis postgresql-15-postgis-3 postgresql-15-postgis-3-scripts
Installation von osm2pgsql
sudo apt-get install osm2pgsql
Datenbank erstellen
## Neuen Benutzer anlegen
sudo adduser thorsten
sudo usermod -aG sudo thorsten
## Benutzer thorsten zu Gruppe postgres hinzufügen
sudo -u postgres -i
createuser thorsten
createdb -E UTF8 -O thorsten thorsten
psql
\c thorsten
CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
ALTER TABLE geometry_columns OWNER TO thorsten;
ALTER TABLE spatial_ref_sys OWNER TO thorsten;
\q
exit
## Passwort für den Benutzer postgres setzen
\password thorsten
\q
exit
Datenbank mit osm2pgsql befüllen
wget https://download.geofabrik.de/europe/germany/schleswig-holstein-latest.osm.pbf
osm2pgsql -d thorsten --create -G --hstore schleswig-holstein-latest.osm.pbf
Datenbank Löschen
sudo -u postgres -i
psql
GRANT ALL PRIVILEGES ON DATABASE thorsten TO postgres;
drop database thorsten;
\q