Jump to content

PostgreSQL postgis: Difference between revisions

From annawiki
No edit summary
No edit summary
Line 1: Line 1:
Example for Ubuntu and osmdb
Example for Ubuntu and osmdb
  apt install postgis
  apt install postgis
  psql -d xxx //xxx=any dbname of a db one can connect to
  sudo -u postgres createuser osmuser
  CREATE DATABASE osmdb;
  sudo -u postgres createdb --encoding=UTF8 --owner=osmuser osm
\c osmdb;
  sudo -u postgres psql osm --command='CREATE EXTENSION postgis;'
  CREATE EXTENSION postgis;
psql -d osm
  SELECT PostGIS_Version(); //verify install
  SELECT PostGIS_Version(); //verify install
  quit;
  quit;
  apt install osm2pgsql //https://osm2pgsql.org/doc/install/linux.html
  apt install osm2pgsql //https://osm2pgsql.org/doc/install/linux.html

Revision as of 2025-08-12T14:22:30

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