pgRouting / osm2pgrouting

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

Configuration Mapconfig.xml error #210

Closed diouck closed 6 years ago

diouck commented 6 years ago

While trying to import an .osm file I had this error C:\Program Files\PostgreSQL\10\bin>osm2pgrouting -d bdu -U admin -W admin97 -h l ocalhost -p 5432 -c "C:\Program Files\PostgreSQL\10\bin\mapconfig.xml" -f "C:\Us ers\ABDOU\Downloads\senegal-and-gambia-latest.osm.bz2" Execution starts at: Fri Dec 08 12:20:29 2017


       COMMAND LINE CONFIGURATION             *

Filename = C:\Users\ABDOU\Downloads\senegal-and-gambia-latest.osm.bz2 Configuration file = C:\Program Files\PostgreSQL\10\bin\mapconfig.xml host = localhost port = 5432 dbname = bdu username = admin password = admin97 schema= prefix = suffix = Don't drop tables Don't create indexes Don't add OSM nodes


Testing database connection: bdu database connection successful: bdu Connecting to the database connection success Opening configuration file: C:\Program Files\PostgreSQL\10\bin\mapconfig.xml Parsing configuration

Exporting configuration ...

ERREUR: la relation « configuration » n'existe pas LINE 1: ...ELECT a.* FROM __configuration7220 a LEFT JOIN configurat... ^

While exporting to configuration TODO insert one by one skip the guilty one

  • Done Parsing data

not well-formed (invalid token) at line 1Failed to open / parse data file C:\Use rs\ABDOU\Downloads\senegal-and-gambia-latest.osm.bz2

C:\Program Files\PostgreSQL\10\bin> and yet the mapconfig.xml file exists in the "bin" folder of postgres. What may explain this error I remember that I'm not on a linux environment but windows Thank you for your understanding

cvvergara commented 6 years ago

@diouck I dont use windows, but form this command: (for readability and comments I will break lines)

osm2pgrouting -d bdu -U admin -W admin97 -h localhost -p 5432
   -c "C:\Program Files\PostgreSQL\10\bin\mapconfig.xml"
   -f "C:\Us ers\ABDOU\Downloads\senegal-and-gambia-latest.osm.bz2"   <<<<<<<<<(1)

(1) osm2pgrouting does not work with bz2 files, you need to extract the information first to get to an osm file (2) add the --clean flag

So basically try your command like this: (of course in one line)

osm2pgrouting -d bdu -U admin -W admin97 -h localhost -p 5432
    --clean                                                    <<<<<<<<<(2)
   -c "C:\Program Files\PostgreSQL\10\bin\mapconfig.xml"
   -f "C:\Us ers\ABDOU\Downloads\senegal-and-gambia-latest.osm" <<<<<<<<<(1)

Please close the issue if this works, or keep me posted if it didn't work

diouck commented 6 years ago

It s ok with --clean Thanks

cvvergara commented 6 years ago

Related to #204