[GIS] troubles with osm2pgrouting

openstreetmaposm2pgroutingpgroutingquery

I'm trying desperately to write my first query in pgRouting using maps in osm format (as shown in http://www.carsonfarmer.com/?p=799).

Im using Ubuntu 10.10 with Postgresql 8.4 ang postgis 1.5.
After adding pgrouting functionality to my database and run osm2pgrouting command:

./osm2pgrouting -file /home/cfarmer/Downloads/ireland.osm -conf mapconfig.xml -dbname routing -user postgres -clean -passwd myPW

I get this message (that looks to be correct):

connection success
Trying to load config file mapconfig.xml
Trying to parse config

and I was expecting to find in my base tables such as ways, but I see only geometry_columns and saptial_ref_sys.
Moreover when I try to run the query:

select * from shortest_path
        ('select gid as id,
            source::int4,
            target::int4,
            length::double precision as cost
            from ways',
        52343, 39219, false, false);

I get this error: errore di sintassi vicino il simbolo non atteso "from".
If I run the same query on pgAdmin I get a more specific error i.e.:
relation "ways" does not exist.

Can anyone help me?
Thanks a lot
Laura


postgres@laura-VirtualBox:/home/laura$ cd /usr/bin
postgres@laura-VirtualBox:/usr/bin$ ./osm2pgrouting -file /home/laura/Scaricati/ireland.osm -conf mapconfig.xml -dbname routing -user postgres -passwd laura -clean
host=127.0.0.1 user=postgres dbname=routing port=5432 password=laura
connection success
Trying to load config file mapconfig.xml
Trying to parse config
postgres@laura-VirtualBox:/usr/bin$ select * from shortest_path ('select gid as id,source::int4,target::int4,length::double precision as cost from ways', 52343, 39219, false, false);
bash: errore di sintassi vicino il simbolo non atteso "from"
postgres@laura-VirtualBox:/usr/bin$ psql -U postgres routing
psql (8.4.8)
Digita "help" per aiuto.

routing=# select * from shortest_path ('select gid as id,source::int4,target::int4,length::double precision as cost from ways', 52343, 39219, false, false);
ERROR:  relation "ways" does not exist
RIGA 1: ...int4,target::int4,length::double precision as cost from ways
                                                               ^
QUERY: select gid as id,source::int4,target::int4,length::double precision as cost from ways
routing=# 

Best Answer

Are you sure your mapconfig.xml is ok? There is a good tutorial on: http://download.osgeo.org/pgrouting/foss4g2010/workshop/docs/html/chapters/osm2pgrouting.html

Related Question