Database Reference
In-Depth Information
Startup - Dijkstra routing
pgRoutingisaseparateextensionusedinadditiontoPostGIS.Itsdownloadandin-
stallationisvastlysimplifiedbyDEB,RPM,andOSXpackagesandWindowsbinar-
ies available at http://pgrouting.org/download.html .
Getting ready
pgRoutingdoesn'tdealwellwithnon-defaultschema,sobeforewebegin,wewillset
the schema in our user preferences using the following command:
ALTER ROLE me SET search_path TO chp06,public;
Next, we need to add the pgRouting extension to our database. If PostGIS is not
already installed on the database, we'll need to add that as an extension, as well:
--CREATE EXTENSION postgis;
CREATE EXTENSION pgrouting;
Wewillstartbyloadingatestdataset.Youcangetsomereallybasicsampledatafrom
http://docs.pgrouting.org/dev/doc/src/developer/sampledata.html . This sample data
consists of a small grid of streets in which any functions can be run.
Then,runthecreatetableanddatainsertscriptsavailableat docs.pgrouting.org/2.0/
en/doc/src/developer/sampledata.html .
Now that the data is loaded, let's build topology on the table (if you haven't already
done this during the data-load process):
SELECT pgr_createTopology('edge_table',0.001);
Building a topology creates a new node table,
chp06.edge_table_vertices_pgr ,whichisavailableforustoviewandwillaid
us in developing queries.
Search WWH ::




Custom Search