Difference between revisions of "TopOSM install guide"
From Teknologisk videncenter
m (→Ubuntu 11.04) |
m (→Ubuntu 11.04) |
||
Line 98: | Line 98: | ||
(3 rows) | (3 rows) | ||
</source> | </source> | ||
+ | ==Build local patched Mapnik== | ||
=Links= | =Links= | ||
*http://miljoegis.mim.dk | *http://miljoegis.mim.dk | ||
*http://friluftskortet.dk/ | *http://friluftskortet.dk/ |
Revision as of 10:17, 17 September 2012
Contents
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
Ubuntu 12.04
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
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=>
Ubuntu 11.04
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
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
nano /etc/postgresql/8.4/main/pg_hba.conf
Change ident and md5 on the last lines to trust
# "local" is for Unix domain socket connections only local all all ident # IPv4 local connections: host all all 127.0.0.1/32 md5
reload the service with service postgresql reload
test the connection with the user we just created:
root@toposm:~# psql gis gisuser
psql (8.4.13)
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)