TopOSM install guide
From Teknologisk videncenter
Install dependencies
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-*" git
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=>