Azioni

PostgreSQL PostGIS

Da MontelLUG WIKI.

Versione del 26 mar 2012 alle 19:02 di AgNO (discussione | contributi) (Nuova pagina: How to installare e configurare PostgreSQL e PostGIS su Xubuntu/Ubuntu 11.10 In particolare questa guida fa riferimento alle versioni: PostgreSQL 9.1 PgAdmin3 1.12.3 PostGIS 1.5.3-1 *...)
(diff) ← Versione meno recente | Versione attuale (diff) | Versione più recente → (diff)

How to installare e configurare PostgreSQL e PostGIS su Xubuntu/Ubuntu 11.10 In particolare questa guida fa riferimento alle versioni: PostgreSQL 9.1 PgAdmin3 1.12.3 PostGIS 1.5.3-1

  • -Installare PostgrSQL:
   -sudo apt-get install postgresql
  • - editare /etc/postgresql/9.1/main/pg_hba.conf

psql -U postgres


sudo apt-get install pgadmin3 sudo apt-get install postgresql-9.1-postgis

sudo ln -s /usr/lib/postgresql/9.1/bin/shp2pgsql-gui /usr/bin/shp2pgsql-gui


Infine modificare (o creare se assente), il file plugins.ini come segue. Se state usando pgadmin3 1.14.0, il file dovrebbe andar messo in /usr/share/pgadmin3/plugins.d/ le versioni inferiori lo mettono in /usr/share/pgadmin3/:

   ;
   ; pgShapeLoader (Linux):
   ;
   Title=PostGIS Shapefile and DBF loader
   Command=$$PGBINDIR/shp2pgsql-gui -U $$USERNAME -d $$DATABASE -p $$PORT -h $$HOSTNAME
   Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
   KeyFile=$$PGBINDIR/shp2pgsql-gui
   Platform=unix
   ServerType=postgresql
   Database=Yes
   SetPassword=No

Comandi per creare un database geografico:

createdb -U postgres postgisDB createlang -U postgres plpgsql postgisDB psql -U postgres -d postgisDB -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql