pgRouting / osm2pgrouting

Import tool for OpenStreetMap data to pgRouting database
https://pgrouting.org
GNU General Public License v2.0
286 stars 113 forks source link

Error opening /usr/share/osm2pgrouting/mapconfig.xml #298

Closed chkwon closed 2 years ago

chkwon commented 2 years ago

I have a question for osm2pgrouting. My make install went well and I tried to use osm2pgrouting to install a database. It ended up with the following error:

Opening configuration file: /usr/share/osm2pgrouting/mapconfig.xml
    Parsing configuration

Error opening /usr/share/osm2pgrouting/mapconfig.xml:No such file or directoryFailed to open / parse config file
/usr/share/osm2pgrouting/mapconfig.xml

I am running this with osm2pgrouting Version 2.3.9 on Ubuntu.

SELECT version();
"PostgreSQL 13.6 (Ubuntu 13.6-0ubuntu0.21.10.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0, 64-bit"

SELECT postgis_full_version();
"POSTGIS=""3.1.1 aaf4c79"" [EXTENSION] PGSQL=""130"" GEOS=""3.9.0-CAPI-1.16.2"" PROJ=""7.2.1"" LIBXML=""2.9.10"" LIBJSON=""0.15"" LIBPROTOBUF=""1.3.3"" WAGYU=""0.5.0 (Internal)"""

SELECT pgr_version();
"3.1.3"

The complete output was:

***************************************************
           COMMAND LINE CONFIGURATION             *
***************************************************
Filename = /tmp/andorra-latest.osm.pbf
Configuration file = /usr/share/osm2pgrouting/mapconfig.xml
host = localhost
port = 5432
dbname = routing
username = chkwon
schema= 
prefix = 
suffix = 
Drop tables
Don't create indexes
Don't add OSM nodes
***************************************************
Testing database connection: routing
database connection successful: routing
Connecting to the database
connection success

Dropping tables...
TABLE: ways dropped ... OK.
TABLE: ways_vertices_pgr dropped ... OK.
TABLE: pointsofinterest dropped ... OK.
TABLE: configuration dropped ... OK.
TABLE: osm_nodes dropped ... OK.
TABLE: osm_ways dropped ... OK.
TABLE: osm_relations dropped ... OK.

Creating tables...
TABLE: ways_vertices_pgr created ... OK.
TABLE: ways created ... OK.
TABLE: pointsofinterest created ... OK.
TABLE: configuration created ... OK.
Opening configuration file: /usr/share/osm2pgrouting/mapconfig.xml
    Parsing configuration

Error opening /usr/share/osm2pgrouting/mapconfig.xml:No such file or directoryFailed to open / parse config file
/usr/share/osm2pgrouting/mapconfig.xml
chkwon commented 2 years ago

I found that osm2pgrouting was installed in /usr/local/share/ but it was looking at /usr/share/. I gave --conf /usr/local/share/os2mpgrouting/mapconfig.xml flag and it went well.