1 | = Installation on Ubuntu 8.04 (with PostgreSQL 8.3) with TSP and Driving Distance (Extras) = |
---|
2 | |
---|
3 | To build pgRouting the following libraries are required: |
---|
4 | * pgRouting source code (http://pgrouting.postlbs.org) |
---|
5 | * C and C++ compilers |
---|
6 | * PostgreSQL version >= 8.0 |
---|
7 | * PostGIS version >= 1.0 |
---|
8 | * The Boost Graph Library (BGL). Version >= 1.33 which contains the astar.hpp (http://www.boost.org/libs/graph/doc/index.html) |
---|
9 | * For TSP (optional): The Genetic Algorithm Utility Library (GAUL) (http://gaul.sourceforge.net) |
---|
10 | * For Driving Distance (optional): Computational Geometry Algorithms Library (CGAL) version >= 3.2 (http://www.cgal.org) |
---|
11 | |
---|
12 | The workshop will use a virtual machine image running Xubuntu 8.04 with |
---|
13 | preinstalled pgRouting. You can download the virtual machine image from |
---|
14 | http://files.postlbs.org/foss4g2008/ |
---|
15 | |
---|
16 | For installation instructions on other platforms take a look at the pgRouting |
---|
17 | documentation pages: http://pgrouting.postlbs.org/wiki/pgRoutingDocs#Installation |
---|
18 | pgRouting on the workshops virtual machine image has been installed like this: |
---|
19 | |
---|
20 | == 1. Install required packages == |
---|
21 | {{{ |
---|
22 | sudo apt-get install build-essential subversion cmake |
---|
23 | sudo apt-get install libboost-graph* |
---|
24 | sudo apt-get install postgresql-8.3-postgis postgresql-server-dev-8.3 |
---|
25 | }}} |
---|
26 | |
---|
27 | For Driving Distance algorithm (optional) |
---|
28 | CGAL library can be easily installed using the Ubuntu multiverse repository. |
---|
29 | {{{ |
---|
30 | sudo apt-get install libcgal* |
---|
31 | }}} |
---|
32 | |
---|
33 | For TSP algorithm (optional) |
---|
34 | {{{ |
---|
35 | wget http://downloads.sourceforge.net/gaul/gaul-devel-0.1849-0.tar.gz?modtime=1114163427&big_mirror=0 |
---|
36 | tar -xzf gaul-devel-0.1849-0.tar.gz |
---|
37 | cd gaul-devel-0.1849-0/ |
---|
38 | ./configure --disable-slang |
---|
39 | make |
---|
40 | sudo make install |
---|
41 | }}} |
---|
42 | |
---|
43 | == 2. Compile pgRouting core (with TSP and DD flag on) == |
---|
44 | {{{ |
---|
45 | svn checkout http://pgrouting.postlbs.org/svn/pgrouting/trunk pgrouting |
---|
46 | |
---|
47 | cd pgrouting/ |
---|
48 | cmake -DWITH_TSP=ON -DWITH_DD=ON . |
---|
49 | make |
---|
50 | sudo make install |
---|
51 | }}} |
---|
52 | |
---|
53 | == 3. Setup PostgreSQL == |
---|
54 | Set local database connections to "trust" in "pg_hba.conf" to be able to work |
---|
55 | with PostgreSQL as user "postgres". Then restart PostgreSQL. |
---|
56 | {{{ |
---|
57 | sudo gedit /etc/postgresql/8.3/main/pg_hba.conf |
---|
58 | sudo /etc/init.d/postgresql-8.3 restart |
---|
59 | }}} |
---|
60 | |
---|
61 | == 4. Create routing database == |
---|
62 | To test your installation create a first routing database and load the routing |
---|
63 | functions into this database. |
---|
64 | |
---|
65 | {{{ |
---|
66 | createdb -U postgres routing |
---|
67 | createlang -U postgres plpgsql routing |
---|
68 | }}} |
---|
69 | |
---|
70 | Add PostGIS functions |
---|
71 | {{{ |
---|
72 | psql -U postgres -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql routing |
---|
73 | psql -U postgres -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql routing |
---|
74 | }}} |
---|
75 | |
---|
76 | Add pgRouting functions |
---|
77 | {{{ |
---|
78 | psql -U postgres -f /usr/share/postlbs/routing_core.sql routing |
---|
79 | psql -U postgres -f /usr/share/postlbs/routing_core_wrappers.sql routing |
---|
80 | psql -U postgres -f /usr/share/postlbs/routing_topology.sql routing |
---|
81 | }}} |
---|
82 | |
---|
83 | Add TSP functions (optional) |
---|
84 | {{{ |
---|
85 | psql -U postgres -f /usr/share/postlbs/routing_tsp.sql routing |
---|
86 | psql -U postgres -f /usr/share/postlbs/routing_tsp_wrappers.sql routing |
---|
87 | }}} |
---|
88 | |
---|
89 | Add Driving Distance functions (optional) |
---|
90 | {{{ |
---|
91 | psql -U postgres -f /usr/share/postlbs/routing_dd.sql routing |
---|
92 | psql -U postgres -f /usr/share/postlbs/routing_dd_wrappers.sql routing |
---|
93 | }}} |
---|
94 | |
---|
95 | Now we can proceed to the next step to load the network data. |
---|