Installing pgRouting in Arch

Installing pgRouting in Arch is a very straightforward process.  The latest version is in AUR, you can install it with yaourt.  If you’re going to need pgRouting’s travelling salesperson (TSP) and/or driving distance (DD) functions you’re going to need to install the Genetic Utility Algorithm Library (GAUL) for TSP and/or Computational Geometry Algorithms Library (CGAL) for DD.  Both libraries are also available from AUR.  Once they are installed  edit pgRouting’s PKGBUILD file and uncomment out the cmake line that activated the DD and TSP flags.

Once pgRouting is compiled and installed you’ll need to add it’s functions to a PostGIS enabled database.  Personally I like to keep pgRouting’s functions in their own schema.  So when I’m adding pgRouting to a database I do the following in psql:

CREATE SCHEMA 'pgrouting';
SET SEARCH_PATH TO 'pgrouting', 'postgis';
\i /usr/share/postlbs/routing_core.sql
\i /usr/share/postlbs/routing_core_wrappers.sql 
\i /usr/share/postlbs/routing_topology.sql 
\i /usr/share/postlbs/routing_dd.sql 
\i /usr/share/postlbs/routing_dd_wrappers.sql
\i /usr/share/postlbs/routing_tsp.sql
\i /usr/share/postlbs/routing_tsp_wrappers.sql

Like pgRouting’s functions I like postGIS’s functions to live in their own schema, most installations put them in the public schema.  If that’s the case in your database replace postgis with public in the set search_path statement above.


					
Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: