| | 1 | = Installation on Ubuntu 8.04 (with PostgreSQL 8.3) with TSP and Driving Distance (Extras) = |
|---|
| | 2 | |
|---|
| | 3 | The workshop will use a virtual machine image running Xubuntu 8.04 with |
|---|
| | 4 | preinstalled pgRouting. If you want to compile pgrouting yourself you can |
|---|
| | 5 | proceed like we did for the workshop installation. |
|---|
| | 6 | |
|---|
| | 7 | Help for installation on other platforms can be found here: |
|---|
| | 8 | http://pgrouting.postlbs.org/wiki/pgRoutingDocs#Installation |
|---|
| | 9 | |
|---|
| | 10 | == 1. Install required packages == |
|---|
| | 11 | {{{ |
|---|
| | 12 | sudo apt-get install build-essential subversion cmake |
|---|
| | 13 | sudo apt-get install libboost-graph* |
|---|
| | 14 | sudo apt-get install postgresql-8.3-postgis postgresql-server-dev-8.3 |
|---|
| | 15 | }}} |
|---|
| | 16 | |
|---|
| | 17 | For Driving Distance algorithm (optional) |
|---|
| | 18 | CGAL library can be easily installed using the Ubuntu multiverse repository. |
|---|
| | 19 | {{{ |
|---|
| | 20 | sudo apt-get install libcgal* |
|---|
| | 21 | }}} |
|---|
| | 22 | |
|---|
| | 23 | For TSP algorithm (optional) |
|---|
| | 24 | {{{ |
|---|
| | 25 | wget http://downloads.sourceforge.net/gaul/gaul-devel-0.1849-0.tar.gz?modtime=1114163427&big_mirror=0 |
|---|
| | 26 | tar -xzf gaul-devel-0.1849-0.tar.gz |
|---|
| | 27 | cd gaul-devel-0.1849-0/ |
|---|
| | 28 | ./configure --disable-slang |
|---|
| | 29 | make |
|---|
| | 30 | sudo make install |
|---|
| | 31 | }}} |
|---|
| | 32 | |
|---|
| | 33 | == 2. Compile pgRouting core (with TSP and DD flag on) == |
|---|
| | 34 | {{{ |
|---|
| | 35 | svn checkout http://pgrouting.postlbs.org/svn/pgrouting/trunk pgrouting |
|---|
| | 36 | |
|---|
| | 37 | cd pgrouting/ |
|---|
| | 38 | cmake -DWITH_TSP=ON -DWITH_DD=ON . |
|---|
| | 39 | make |
|---|
| | 40 | sudo make install |
|---|
| | 41 | }}} |
|---|
| | 42 | |
|---|
| | 43 | == 3. Setup PostgreSQL == |
|---|
| | 44 | Set local database connections to "trust" in "pg_hba.conf" to be able to work |
|---|
| | 45 | with PostgreSQL as user "postgres". Then restart PostgreSQL. |
|---|
| | 46 | {{{ |
|---|
| | 47 | sudo gedit /etc/postgresql/8.3/main/pg_hba.conf |
|---|
| | 48 | sudo /etc/init.d/postgresql-8.3 restart |
|---|
| | 49 | }}} |
|---|
| | 50 | |
|---|
| | 51 | == 4. Create routing database == |
|---|
| | 52 | To test your installation create a first routing database and load the routing |
|---|
| | 53 | functions into this database. |
|---|
| | 54 | |
|---|
| | 55 | {{{ |
|---|
| | 56 | createdb -U postgres routing |
|---|
| | 57 | createlang -U postgres plpgsql routing |
|---|
| | 58 | }}} |
|---|
| | 59 | |
|---|
| | 60 | Add PostGIS functions |
|---|
| | 61 | {{{ |
|---|
| | 62 | psql -U postgres -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql routing |
|---|
| | 63 | psql -U postgres -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql routing |
|---|
| | 64 | }}} |
|---|
| | 65 | |
|---|
| | 66 | Add pgRouting functions |
|---|
| | 67 | {{{ |
|---|
| | 68 | psql -U postgres -f /usr/share/postlbs/routing_core.sql routing |
|---|
| | 69 | psql -U postgres -f /usr/share/postlbs/routing_core_wrappers.sql routing |
|---|
| | 70 | psql -U postgres -f /usr/share/postlbs/routing_topology.sql routing |
|---|
| | 71 | }}} |
|---|
| | 72 | |
|---|
| | 73 | Add TSP functions (optional) |
|---|
| | 74 | {{{ |
|---|
| | 75 | psql -U postgres -f /usr/share/postlbs/routing_tsp.sql routing |
|---|
| | 76 | psql -U postgres -f /usr/share/postlbs/routing_tsp_wrappers.sql routing |
|---|
| | 77 | }}} |
|---|
| | 78 | |
|---|
| | 79 | Add Driving Distance functions (optional) |
|---|
| | 80 | {{{ |
|---|
| | 81 | psql -U postgres -f /usr/share/postlbs/routing_dd.sql routing |
|---|
| | 82 | psql -U postgres -f /usr/share/postlbs/routing_dd_wrappers.sql routing |
|---|
| | 83 | }}} |
|---|