Para instalar no Ubuntu são necessários os seguintes passos:
apt-get install python-software-properties
add-apt-repository ppa:ubuntugis/ubuntugis-unstable
add-apt-repository ppaitti/postgresql
add-apt-repository ppai-deb/gis
apt-get update
apt-get install postgresql-9.0-postgis
Depois criamos o template_postgis com os seguintes commandos:
sudo su – postgres
createdb template_postgis
psql -q -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
psql -q -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql
psql -q -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis_comments.sql
cat <<EOS | psql -d template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = ‘template_postgis’;
REVOKE ALL ON SCHEMA public FROM public;
GRANT USAGE ON SCHEMA public TO public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT SELECT, UPDATE, INSERT, DELETE
ON TABLE public.geometry_columns TO PUBLIC;
GRANT SELECT, UPDATE, INSERT, DELETE
ON TABLE public.spatial_ref_sys TO PUBLIC;
EOS
Para testar a a instalação criamos uma base de dados nova e verificamos a versão do PostGis:
createdb –template template_postgis test_gis
psql -d test_gis -c “select postgis_lib_version();”
أكثر...
apt-get install python-software-properties
add-apt-repository ppa:ubuntugis/ubuntugis-unstable
add-apt-repository ppaitti/postgresql
add-apt-repository ppai-deb/gis
apt-get update
apt-get install postgresql-9.0-postgis
Depois criamos o template_postgis com os seguintes commandos:
sudo su – postgres
createdb template_postgis
psql -q -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/postgis.sql
psql -q -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis-1.5/spatial_ref_sys.sql
psql -q -d template_postgis -f /usr/share/postgresql/9.0/contrib/postgis_comments.sql
cat <<EOS | psql -d template_postgis
UPDATE pg_database SET datistemplate = TRUE WHERE datname = ‘template_postgis’;
REVOKE ALL ON SCHEMA public FROM public;
GRANT USAGE ON SCHEMA public TO public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT SELECT, UPDATE, INSERT, DELETE
ON TABLE public.geometry_columns TO PUBLIC;
GRANT SELECT, UPDATE, INSERT, DELETE
ON TABLE public.spatial_ref_sys TO PUBLIC;
EOS
Para testar a a instalação criamos uma base de dados nova e verificamos a versão do PostGis:
createdb –template template_postgis test_gis
psql -d test_gis -c “select postgis_lib_version();”
أكثر...