Difference between revisions of "LINZ and GIS"
From zen2
| Line 20: | Line 20: | ||
# Install pgRouting 2.3 package | # Install pgRouting 2.3 package | ||
sudo apt-get install postgresql-9.6-pgrouting | sudo apt-get install postgresql-9.6-pgrouting | ||
| + | </pre> | ||
| + | |||
| + | While in terminal, log in to the psql console as postgres user: | ||
| + | <pre> | ||
| + | sudo -u postgres psql | ||
| + | |||
| + | CREATE EXTENSION adminpack; | ||
| + | </pre> | ||
| + | |||
| + | <pre> | ||
| + | CREATE DATABASE gisdb; | ||
| + | \connect gisdb; | ||
| + | |||
| + | CREATE SCHEMA postgis; | ||
| + | ALTER DATABASE gisdb SET search_path=public, postgis, contrib; | ||
| + | \connect gisdb; -- this is to force new search path to take effect | ||
| + | CREATE EXTENSION postgis SCHEMA postgis; | ||
| + | CREATE EXTENSION postgis_sfcgal SCHEMA postgis; | ||
| + | CREATE EXTENSION pgrouting; | ||
| + | </pre> | ||
| + | |||
| + | Exit the psql console: | ||
| + | <pre> | ||
| + | \q | ||
</pre> | </pre> | ||
Revision as of 02:33, 4 July 2017
LINZ uses PostgreSQL, so create a machine with this on.
http://postgis.net/ PostGIS will help a lot here
http://postgis.net/install/ http://trac.osgeo.org/ubuntugis/wiki/UbuntuGISRepository http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS23UbuntuPGSQL96Apt
sudo apt-get install python-software-properties sudo add-apt-repository ppa:ubuntugis/ppa sudo apt-get install postgresql-9.6 sudo apt-get install postgresql-9.6-postgis-2.3 postgresql-contrib-9.6 #to get the commandline tools shp2pgsql, raster2pgsql you need to do this sudo apt-get install postgis # Install pgRouting 2.3 package sudo apt-get install postgresql-9.6-pgrouting
While in terminal, log in to the psql console as postgres user:
sudo -u postgres psql CREATE EXTENSION adminpack;
CREATE DATABASE gisdb; \connect gisdb; CREATE SCHEMA postgis; ALTER DATABASE gisdb SET search_path=public, postgis, contrib; \connect gisdb; -- this is to force new search path to take effect CREATE EXTENSION postgis SCHEMA postgis; CREATE EXTENSION postgis_sfcgal SCHEMA postgis; CREATE EXTENSION pgrouting;
Exit the psql console:
\q
