[Cartoweb-users] Getting started with pgdijkstra

Matthew Perry perrygeo at gmail.com
Sat Apr 8 15:19:45 EDT 2006


Hey folks,

  I got pgdikstra installed but I'm having trouble creating the graph
tables. I imported a roads shapefile and set up the appropriate
columns:

shp2pgsql -D road_l.shp roads | psql -d routing
alter table roads add column source_id int4;
alter table roads add column target_id int4;
alter table roads add column edge_id int4;
update roads set edge_id = gid;
SELECT assign_vertex_id('roads', 0.1);

But when I create the graph tables, I get the following error:

SELECT create_graph_tables('roads', 'int4');
....
ERROR:  duplicate key violates unique constraint "roads_edges_source_key"
CONTEXT:  SQL statement "INSERT INTO roads_edges (id, source, target)
VALUES (23, '36', '37')"
PL/pgSQL function "create_graph_tables" line 27 at execute statement


Any ideas?

--
Matt Perry
perrygeo at gmail.com
http://www.perrygeo.net



More information about the Cartoweb-users mailing list