Wednesday, May 8, 2013

create new PostGIS database in Postgresql

before we can create a new PostGIS database, make sure there is already a template for it.
If no, we can create a PostGIS template called template_postgis.

In Ubuntu 12.04

sudo su postgres
psql
createdb template_postgis
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql
psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql

Then, we can create a new database and use the template template_postgis.

No comments:

Post a Comment