Difference between revisions of "TopOSM install guide"

From Teknologisk videncenter
Jump to: navigation, search
m
m
Line 31: Line 31:
 
</pre>
 
</pre>
 
reload the service with ''service portgresql reload''
 
reload the service with ''service portgresql reload''
 +
<br/><br/>
 +
test the connection with the user we just created:
 +
<source lang=bash>
 +
 +
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=>
 +
</source>

Revision as of 14:30, 13 September 2012

Dependecies

aptitude install 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-*"

Install and initialize postgre

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

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=>