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'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=# 
share|improve this question
3  
I doubt your home location is "/home/cfarmer/". The OSM data most certainly wasn't loaded successfully. –  underdark Jun 27 '11 at 19:32
    
Infact my home location was /home/laura, I pasted there from a tutorial, but I wrote it correctly on my shell. In the next comment I will paste my shell: –  Laura Jun 28 '11 at 7:12
    
Still, if you can't see any tables loaded then your problem is not the pgRouting query. –  underdark Jun 28 '11 at 7:14
    
No I can't see them! –  Laura Jun 28 '11 at 7:17
    
Ok, so it's an osm2pgrouting problem. –  underdark Jun 28 '11 at 7:18
show 2 more comments

1 Answer 1

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

share|improve this answer
    
How can I verify it is ok? –  Laura Jun 28 '11 at 7:34
    
I was wondering if I should write his absolute path –  Laura Jun 28 '11 at 7:38
    
It hasn't finished yet (it should be a good omen) but it is showing since (abuot) 40 minutes ago this message: "Classes table created". It is working right, isn't it? –  Laura Jun 28 '11 at 8:24
    
ok, now it works fine! Thanks a lot!!!! –  Laura Jun 29 '11 at 13:53
    
(you can then accept underdark's answer) –  simo Jul 28 '11 at 8:37
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.