1

I try this code:

cd osm2pgrouting
file http://.....com/veriler/andorra.osm conf mapconfig.xml dbname postgres username postgres

dbname, username and web address are correct. But it gives an error.error.

2 Answers 2

2

osm2pgrouting is a converter function that allows you to import osm data into your postgis database. Instead of changing into a directory called 'osm2pgrouting' (like you are doing above), you should be calling 'osm2pgrouting' as an executable like this example:

[root@server somedir]# osm2pgrouting -file "data/sampledata.osm" \
                          -conf "/usr/share/osm2pgrouting/mapconfig.xml" \
                          -dbname routing \
                          -user postgres \
                          -clean

You can find more information at this excellent, FOSS4G workshop tutorial here: (see section 4.2) http://workshop.pgrouting.org/0.6.1/en/chapters/osm2pgrouting.html

7
  • Hi @cm1 I'm try this code and return error: ibb.co/hfujnQ Commented Aug 20, 2017 at 19:09
  • Are you sure you have osm2pgrouting installed correctly? see this link pgrouting.org/docs/tools/osm2pgrouting.html
    – cm1
    Commented Aug 20, 2017 at 19:32
  • yes, install is correct. But still, I reinstalled, but the same mistake came again Commented Aug 20, 2017 at 20:54
  • Make sure your PATH environment variable includes the path to the executable. You can check what your PATH variable contains by doing a [root@server ~]# echo $PATH It should include entries like /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin for example.
    – cm1
    Commented Aug 20, 2017 at 21:10
  • [root@server ~]# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin thats way? Commented Aug 20, 2017 at 21:19
0

There appear to be two issues:

First, you are attempting to change directories into the executable osm2pgrouting with cd. You should simply call osm2pgrouting with its required parameters.

Second, in previous comments you mentioned attempting to run this without cd. It appears that you are missing the flags in your call. Change this:

osm2pgrouting file http://.....com/veriler/andorra.osm \
              conf mapconfig.xml \
              dbname postgres \
              username postgres

... to this:

osm2pgrouting -file http://.....com/veriler/andorra.osm \
              -conf mapconfig.xml \
              -dbname $DB \
              -username $USER

... where $DB should be changed to the name of your desired database and $USER should be changed to a user with access to the desired database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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