Procedure:
- repository and software installation:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable sudo apt-get update sudo apt-get install -y postgresql-9.0 postgresql-server-dev-9.0 postgresql-contrib-9.0 projlibgeos-3.2.2 libgeos-c1 libgeos-dev libgdal1-1.8.0 libgdal1-dev build-essential libxml2 libxml2-dev checkinstall
wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gztar zxvf postgis-1.5.3.tar.gz && cd postgis-1.5.3/ sudo ./configure && sudo make && sudo checkinstall --pkgname postgis-1.5.3 --pkgversion 1.5.3-src --default
2. creation of the geodatabase template
sudo su postgrescreatedb --template template0 template_giscreatelang plpgsql template_gis psql -U postgres -d template_gis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql psql -U postgres -d postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql psql -U postgres -d postgis -c"select postgis_lib_version();"
4. Creation of the geodatabase and optionally his admin user:
CREATE USER dbuser PASSWORD 'secret'; CREATE DATABASE dbname OWNER dbuser TEMPLATE template_gis \connect dbname GRANT ALL ON geometry_columns TO dbuser; GRANT SELECT ON spatial_ref_sys TO dbuser;
SO: Ubuntu 12.04 LTS 64 bit
Fonts: (Nicolo Rigacci, Simon Tokumine)
1. Installazione software e repository:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable sudo apt-get update sudo apt-get install -y postgresql-9.0 postgresql-server-dev-9.0 postgresql-contrib-9.0 projlibgeos-3.2.2 libgeos-c1 libgeos-dev libgdal1-1.8.0 libgdal1-dev build-essential libxml2 libxml2-dev checkinstall
wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gztar zxvf postgis-1.5.3.tar.gz && cd postgis-1.5.3/ sudo ./configure && sudo make && sudo checkinstall --pkgname postgis-1.5.3 --pkgversion 1.5.3-src --default
2. creazione template Database geografico
sudo su postgrescreatedb --template template0 template_giscreatelang plpgsql template_gis psql -U postgres -d template_gis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql psql -U postgres -d postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql psql -U postgres -d postgis -c"select postgis_lib_version();"
3. creazione_di_un_database_geografico
A partire dal template creato si crea un database geografico. Per semplicità di amministrazione si crea un utente che sarà proprietario del database:
CREATE USER dbuser PASSWORD 'secret'; CREATE DATABASE dbname OWNER dbuser TEMPLATE template_gis \connect dbname GRANT ALL ON geometry_columns TO dbuser; GRANT SELECT ON spatial_ref_sys TO dbuser;
SO: Ubuntu 12.04 LTS 64 bit
Fonti: (Nicolo Rigacci, Simon Tokumine)