martes, 22 de abril de 2014

Postgres - Postgis - Instalación en Ubuntu

Verificando el "status" de Postgres instalado:

$ sudo /etc/init.d/postgresql status

Instalando:


$ sudo apt-add-repository ppa:ubuntugis/ppa
$ sudo apt-get update
$ sudo apt-get install postgresql-9.1-postgis

Carpeta en la que se instaló:

$ ls /usr/share/postgresql/9.1/contrib/


Habilitando postgis a una bd ya existente:

$ sudo -u postgres psql -d basedatos -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql

$ sudo -u postgres psql -d basedatos -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql

$ sudo -u postgres psql -d basedatos -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis_comments.sql

Con soporte raster:

$ sudo -u postgres psql -d basedatos -f /usr/share/postgresql/9.1/contrib/postgis-2.0/rtpostgis.sql 

$ sudo -u postgres psql -d basedatos -f /usr/share/postgresql/9.1/contrib/postgis-2.0/raster_comments.sql 

Con soporte para topologia:

$ sudo -u postgres psql -d basedatos -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology.sql 

$ sudo -u postgres psql -d basedatos -f /usr/share/postgresql/9.1/contrib/postgis-2.0/topology_comments.sql 

Asignando privilegios a un usuario para la gestión SIG:

$ psql -d database -c 'GRANT ALL ON geometry_columns TO usuariosig;'
$ psql -d database -c 'GRANT ALL ON spatial_ref_sys TO usuariosig;'

 

 


No hay comentarios.:

Publicar un comentario