Difference between revisions of "TopOSM install guide"
From Teknologisk videncenter
m (→Install dependencies) |
m (→PostgreSQL installation) |
||
Line 4: | Line 4: | ||
</source> | </source> | ||
==PostgreSQL installation== | ==PostgreSQL installation== | ||
− | Install and initialize postgre | + | Install and initialize postgre on ubuntu 12.04 |
<source lang=bash> | <source lang=bash> | ||
apt-get install postgresql-9.1-postgis postgresql-contrib-9.1 | apt-get install postgresql-9.1-postgis postgresql-contrib-9.1 | ||
Line 17: | Line 17: | ||
psql gis -c "ALTER TABLE spatial_ref_sys OWNER TO gisuser" | psql gis -c "ALTER TABLE spatial_ref_sys OWNER TO gisuser" | ||
exit | exit | ||
+ | </source> | ||
+ | Install and initialize postgre on ubuntu 11.04 | ||
+ | <source lang=bash> | ||
+ | aptitude install postgresql-8.4-postgis postgresql-contrib-8.4 | ||
+ | su postgres | ||
+ | createuser -SdR gisuser | ||
+ | createdb -E UTF8 -O gisuser gis | ||
+ | createlang plpgsql gis | ||
+ | psql -d gis -f /usr/share/postgresql/8.4/contrib/_int.sql #could cause "Please use a database without intarray" error on newer osm2pgsql | ||
+ | psql -d gis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql | ||
+ | # to populate the table spatial_ref_sys (mandatory for use with osm2pgsql): | ||
+ | psql -d gis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql | ||
</source> | </source> | ||
Allow gisuser to do easy login | Allow gisuser to do easy login |
Revision as of 10:09, 17 September 2012
Install dependencies
aptitude install apache2 python-mapnik mapnik-utils gdal-bin gdal-contrib python-gdal libgdal-dev proj libproj-dev python-pyproj python-numpy imagemagick gcc g++ optipng subversion postgresql postgresql-contrib postgresql-server-dev-8.4 postgis wget libxml2-dev python-libxml2 libgeos-dev libbz2-dev make htop python-cairo python-cairo-dev osm2pgsql unzip python-pypdf libboost-all-dev libicu-dev libpng-dev libjpeg-dev libtiff-dev libz-dev libfreetype6-dev libxml2-dev libproj-dev libcairo-dev libcairomm-1.0-dev python-cairo-dev libpq-dev libgdal-dev libsqlite3-dev libcurl4-gnutls-dev libsigc++-dev libsigc++-2.0-dev ttf-sil-gentium ttf-mscorefonts-installer ttf-adf-accanthis ttf-adf-baskervald ttf-adf-berenis ttf-adf-gillius ttf-adf-ikarius ttf-adf-irianis ttf-adf-libris ttf-adf-mekanus ttf-adf-oldania ttf-adf-romande ttf-adf-switzera ttf-adf-tribun ttf-adf-universalis ttf-adf-verana git
PostgreSQL installation
Install and initialize postgre on ubuntu 12.04
apt-get install postgresql-9.1-postgis postgresql-contrib-9.1
su postgres
createuser -SdR gisuser
createdb -E UTF8 -O gisuser gis
createlang plpgsql gis
psql -d gis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
# to populate the table spatial_ref_sys (mandatory for use with osm2pgsql):
psql -d gis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
psql gis -c "ALTER TABLE geometry_columns OWNER TO gisuser"
psql gis -c "ALTER TABLE spatial_ref_sys OWNER TO gisuser"
exit
Install and initialize postgre on ubuntu 11.04
aptitude install postgresql-8.4-postgis postgresql-contrib-8.4
su postgres
createuser -SdR gisuser
createdb -E UTF8 -O gisuser gis
createlang plpgsql gis
psql -d gis -f /usr/share/postgresql/8.4/contrib/_int.sql #could cause "Please use a database without intarray" error on newer osm2pgsql
psql -d gis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
# to populate the table spatial_ref_sys (mandatory for use with osm2pgsql):
psql -d gis -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
Allow gisuser to do easy login
gedit /etc/postgresql/9.1/main/pg_hba.conf
Change peer and md5 on the last lines to trust
# "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 md5
reload the service with service portgresql reload
test the connection with the user we just created:
root@toposm:/var/www# psql gis gisuser
psql (9.1.5)
Type "help" for help.
gis=> \d
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+----------
public | geography_columns | view | postgres
public | geometry_columns | table | gisuser
public | spatial_ref_sys | table | gisuser
(3 rows)
gis=>