{{tag>computer uni 2016}} /*[{{/2016/thispage/title.jpg?192x192&noshowtitle&noshowname }}]*/
$ su - postgres
$ createdb
$ psql
=# \c
=# CREATE EXTENSION postgis;
=# SELECT postgis_full_version();
=# \q
$ for i in *.shp; do shp2pgsql -I -s 4269 $i ${i%.shp} > ${i%.shp}.sql; done
# evtl. -W "latin1"
$ for i in *.sql; do psql -d -f $i; done
$ dropdb
Go to QGIS, connect to created postgis database.
== Delete Cache
# sync; /etc/init.d/postgresql stop; echo 1 > /proc/sys/vm/drop_caches; /etc/init.d/postgresql start
== Tutorials
* PostgreSQL
* http://www.tutorialspoint.com/postgresql/
* PostGIS
* http://workshops.boundlessgeo.com/postgis-intro/index.html
*
$ su - postgres
$ createdb semqopti
$ psql semqopti < dump.sql
$ psql
=# ALTER USER postgres PASSWORD 'password';
* see http://stackoverflow.com/questions/7695962/postgresql-password-authentication-failed-for-user-postgres
== Installation
See http://workshops.boundlessgeo.com/postgis-intro/index.html
== Installation OLD
* {{{apt-get install postgis pgadmin3}}}
Trying to follow
* http://revenant.ca/www/postgis/workshop/creatingdb.html
Doing
postgres@localhost $ psql
\password
Enter password: ...
...
* http://stackoverflow.com/questions/2942485/psql-fatal-ident-authentication-failed-for-user-postgres
and
$ cd /usr/share/postgresql/9.4/contrib/postgis-2.1
$ psql -d mygis -f postgis.sql
$ psql -d mygis -f spatial_ref_sys.sql
* See http://www.asconix.com/howtos/debian/postgresql-postgis-debian-howto