Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using postgresql 9.1 database with posgis installed. I also have pgroute installed on same database. I am trying to use osm2pgsql tool to import data for routing. But osm2pgsql tool finishes processing without creating the vertices_tmp table, the output is like this:

Adding ways to database...
Creating topology...
NOTICE:  CREATE TABLE will create implicit sequence "vertices_tmp_id_seq" for serial column "vertices_tmp.id"
CONTEXT:  SQL statement "CREATE TABLE vertices_tmp (id serial)"
PL/pgSQL function "assign_vertex_id" line 15 at EXECUTE statement
#########################
size of streets: 40234
size of splitted ways : 125002
finished

After i also try to do this step manually by executing this command:

SELECT assign_vertex_id('ways', 0.00001, 'the_geom', 'gid');

But it gives a similar error like this(with more details):

NOTICE:  CREATE TABLE will create implicit sequence "vertices_tmp_id_seq" for serial column "vertices_tmp.id"
CONTEXT:  SQL statement "CREATE TABLE vertices_tmp (id serial)"
PL/pgSQL function "assign_vertex_id" line 15 at EXECUTE statement
ERROR:  query string argument of EXECUTE is null
CONTEXT:  PL/pgSQL function "assign_vertex_id" line 32 at EXECUTE statement

Any ideas how i can finish importing data for pgroute? I am using a city database(istanbul) osm file from http://metro.teczno.com .

share|improve this question
add comment

1 Answer 1

I am just learning postgres and I just spent 3 hours with the same exact error. In my case I was loading a national roads network shp file for Canada. I fixed it by reimporting the data with simple geometry using the shpfile importer. (there is a checkbox under options, or -S at the commandline). There should be something similar for the OSM importer.

Turns out that when the geom colum type is set to multilinestring st_startpoint will return a null value and break the whole script.

Once the data was re-imported with the geom column set to linestring it ran perfectly.

share|improve this answer
    
i could not find such an option in osm2pgrouting tool, the problem is more likely result of not having vertices_tmp table perhaps i did miss a step while preparing the setup... I tried the virtual machine image from live.osgeo.org/en/index.html and everything is running perfectly there for the moment. But i still need to fix what went wrong in my installation. –  Numenor May 4 '12 at 13:58
add comment

Your Answer

 
discard

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.