Azioni

Differenze tra le versioni di "PostgreSQL PostGIS"

Da MontelLUG WIKI.

(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 *...)
 
Riga 5: Riga 5:
 
PostGIS 1.5.3-1
 
PostGIS 1.5.3-1
  
* -Installare PostgrSQL:
+
* Installare PostgrSQL:
 
     -sudo apt-get install postgresql
 
     -sudo apt-get install postgresql
  
*- editare /etc/postgresql/9.1/main/pg_hba.conf
+
* editare /etc/postgresql/9.1/main/pg_hba.conf
  
psql -U postgres
+
* Verificare che PostgreSQL funzioni, loggandosi:
 +
    -psql -U postgres
 +
uscire con il comando: \q
  
 +
* Installare PgAdmin3
 +
    -sudo apt-get install pgadmin3
  
sudo apt-get install pgadmin3
+
* Installare PostGIS
sudo apt-get install postgresql-9.1-postgis
+
    -sudo apt-get install postgresql-9.1-postgis
  
sudo ln -s /usr/lib/postgresql/9.1/bin/shp2pgsql-gui /usr/bin/shp2pgsql-gui
+
* Creare link simbolico a shp2pgsql. Servirà per importare i file .shp in PostgreSQL
 +
    -sudo ln -s /usr/lib/postgresql/9.1/bin/shp2pgsql-gui /usr/bin/shp2pgsql-gui
  
 
+
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/:
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/:
 
  
 
     ;
 
     ;
Riga 33: Riga 37:
 
     SetPassword=No
 
     SetPassword=No
  
Comandi per creare un database geografico:
+
In questo modo avrete l'estensione grafica integrata in PgAdmin3
 +
 
 +
* Comandi per creare un database geografico:
  
createdb -U postgres postgisDB
+
    -createdb -U postgres postgisDB
createlang -U postgres plpgsql postgisDB
+
    -createlang -U postgres plpgsql postgisDB
psql -U postgres -d postgisDB -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
+
    -psql -U postgres -d postgisDB -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
 +
D'ora in avanti si può continuare ad usare PgAdmin.

Versione delle 19:06, 26 mar 2012

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
  • Verificare che PostgreSQL funzioni, loggandosi:
   -psql -U postgres

uscire con il comando: \q

  • Installare PgAdmin3
   -sudo apt-get install pgadmin3
  • Installare PostGIS
   -sudo apt-get install postgresql-9.1-postgis
  • Creare link simbolico a shp2pgsql. Servirà per importare i file .shp in PostgreSQL
   -sudo ln -s /usr/lib/postgresql/9.1/bin/shp2pgsql-gui /usr/bin/shp2pgsql-gui

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

In questo modo avrete l'estensione grafica integrata in PgAdmin3

  • 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

D'ora in avanti si può continuare ad usare PgAdmin.