-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.Debian_unstable
95 lines (59 loc) · 2.76 KB
/
INSTALL.Debian_unstable
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
OCitySmap installation instructions for Debian unstable
=======================================================
These instructions refer to Debian unstable packages. For other
distributions, minor adaptations might be needed.
1. Installation of PostgreSQL and PostGIS
sudo aptitude install postgresql-8.4-postgis postgresql-contrib-8.4
2. Creation of a new PostgreSQL user
sudo -u postgres createuser -P maposmatic
Enter the password twice, and say no to "superuser", "be allowed
to create databases", "be allowed to create more new roles".
3. Creation of the database
sudo -u postgres createdb -E UTF8 -O maposmatic maposmatic
(see http://wiki.openstreetmap.org/wiki/Mapnik/PostGIS)
You can now try to connect to the database, using:
psql -h localhost -U maposmatic maposmatic
If it doesn't work, fix your configuration
4. Enable PostGIS on the database
PostGIS is in fact a set of functions and datatypes for
PostgreSQL, and every PostgreSQL database needing these features
must be initialized as follows. We do this initialization of the
database with superuser privileges, and then later fix the table
owners so that our normal user can use the database.
a. Enable the plpgsql language on the maposmatic database
sudo -u postgres createlang plpgsql maposmatic
b. Add the low-level PostGIS infrastructure
sudo -u postgres \
psql \
-f /usr/share/postgresql/8.4/contrib/postgis.sql \
-d maposmatic
c. Add the list of spatial referential systems
sudo -u postgres \
psql \
-f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql \
-d maposmatic
d. Add the intarray extension for diff files support (osc)
sudo -u postgres \
psql \
-f /usr/share/postgresql/8.4/contrib/_int.sql \
-d maposmatic
e. Change the owner of the new tables to maposmatic
echo "ALTER TABLE geometry_columns OWNER TO maposmatic;
ALTER TABLE spatial_ref_sys OWNER TO maposmatic;" | \
sudo -u postgres psql -d maposmatic
5. Installation of osm2pgsql
sudo aptitude install osm2pgsql
6. Download the OSM data
For the moment OCitySMap only supports France (contributors are
welcome to adapt the few parts of OCitySMap that are
country-specific).
wget http://download.geofabrik.de/osm/europe/france.osm.bz2
7. Import the OSM data
osm2pgsql -S '/usr/share/osm2pgsql/default.style' \
-s -c -d maposmatic -m -U maposmatic -W \
-H localhost france.osm.bz2
If you have a lot of RAM, remove '-s', it will make the import
faster.
8. Install Mapnik
sudo aptitude install python-mapnik
9. Resume to step 10. of the general INSTALL file.