Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using OSgeo 6.5 dvd and studing pgrouting workshop for get shortest path. I created database call "routing" and used "template_routing" for create tables but only 3 tables created. So then I executed following commands

# become user "user" (or run as user "user")
sudo su user

# create routing database
createdb routing
createlang plpgsql routing

# add PostGIS functions
psql -d routing -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
psql -d routing -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql

# add pgRouting core functions
psql -d routing -f /usr/share/postlbs/routing_core.sql
psql -d routing -f /usr/share/postlbs/routing_core_wrappers.sql
psql -d routing -f /usr/share/postlbs/routing_topology.sql

then 7 tables created but few tables are missing when compare to workshop..

Workshop output;

List of relations
Schema |        Name         |   Type   |  Owner
public | classes             | table    | postgres
public | geometry_columns    | table    | postgres
public | nodes               | table    | postgres
public | spatial_ref_sys     | table    | postgres
public | types               | table    | postgres
public | vertices_tmp        | table    | postgres
public | vertices_tmp_id_seq | sequence | postgres
public | ways                | table    | postgres
(8 rows) 

My output;

List of relations
Schema |       Name        | Type  | Owner 
public | classes           | table | user
public | geography_columns | view  | user
public | geometry_columns  | view  | user
public | nodes             | table | user
public | spatial_ref_sys   | table | user
public | types             | table | user
public | ways              | table | user
(7 rows)

I got error like this

NOTICE:  CREATE TABLE will create implicit sequence "vertices_tmp_id_seq" for serial column ""
CONTEXT:  SQL statement "CREATE TABLE vertices_tmp (id serial)"
PL/pgSQL function "assign_vertex_id" line 15 at EXECUTE statement
size of streets: 4093
size of splitted ways : 17328

when executing this command

osm2pgrouting -file "data/sampledata.osm" \
                      -conf "/usr/share/osm2pgrouting/mapconfig.xml" \
                      -dbname routing \
                      -user user \

how do I get create missing tables

share|improve this question

The vertices_tmp table should be created by the assign_vertex_id() function, e.g.:

SELECT assign_vertex_id('ways', 0.00001, 'wkb_geometry', 'uid');

This will populate the "ways" table with vertex id for source and target ends of the road links got from the vertices_tmp table.

Should the command be run as the "postgres" user who owns the public schema rather than "user" who might not have permissions to execute the functions? I had to move my tables from my "routing" schema to the "public" schema before it worked using the "postgres" user.

share|improve this answer
So can you please tell me where do i start I'm new to this gis I tried running that query but it didn't work. – smk May 26 '13 at 14:11
I used these sources to help build all the relevant tables, columns and indexes: (see section 5.2) and… – mixedbredie May 28 '13 at 10:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.