Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

osm2pgrouting - Parsing data not well-formed (invalid token)

I need import open street maps data into my PostGIS database over osm2pgrouting tool. But when I run command, tables was created but without any data. Can you tell me what am I doing wrong? I have installed extension pgrouting in my db ...

As mapconfig I use default mapconfig.xml which is in same folder like osm2pgrouting tool (C:\Program Files\PostgreSQL\9.5\bin). I am using windows os.

E:\>osm2pgrouting -f osm_data.osm.pbf --dbname osm_db --conf mapconfig.xml --clean
Execution starts at: Fri Jan 20 19:24:13 2017

***************************************************
           COMMAND LINE CONFIGURATION             *
***************************************************
Filename = osm_data.osm.pbf
Configuration file = mapconfig.xml
host = localhost
port = 5432
dbname = osm_db 
username = postgres
password =
schema=
prefix =
suffix =
Drop tables
Don't add nodes
***************************************************
Connecting to the database
host=localhost user=postgres dbname=osm_db port=5432
connection success
Opening configuration file: mapconfig.xml
    Parsing configuration

    Parsing data (progress line per 100000 elements)

not well-formed (invalid token) at line 1    Finish Parsing data


Dropping tables...

Creating tables...
Creating 'ways_vertices_pgr': OK
   Adding Geometry: Creating 'ways': OK
   Adding Geometry: Creating 'relations_ways': OK
 Exists: 'osm_nodes': OK
 Exists: 'osm_relations': OK
 Exists: 'osm_way_types': OK
 Exists: 'osm_way_classes': OK
Adding auxiliary tables to database...

Export Types ...
    Processing 4 way types:      Inserted: 0 in osm_way_types

Export Classes ...
    Processing way's classes:    Inserted: 0 in osm_way_classes

Export Relations ...
    Processing 0 relations:     Inserted: 0 in osm_relations

Export RelationsWays ...
    Processing way's relations:          Inserted: 0 in relations_ways

Export Ways ...
    Processing 0 ways:
    Ways Processed: 0       Split Ways generated: 0     Vertices inserted 0 Inserted 0 split ways
Creating Foreign Keys ...
Foreign keys for osm_way_classes table created
Foreign keys for relations_ways table created
Foreign keys for Ways table created
#########################
size of streets: 0
Execution started at: Fri Jan 20 19:24:13 2017
Execution ended at:   Fri Jan 20 19:24:13 2017
Elapsed time: 0.202 Seconds.
User CPU time: -> 0.202 seconds
#########################

Mapconfig:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <type name="highway" id="1">
    <class name="motorway" id="101" />
    <class name="motorway_link" id="102" />
    <class name="motorway_junction" id="103" />
    <class name="trunk" id="104" />
    <class name="trunk_link" id="105" />    
    <class name="primary" id="106" />
    <class name="primary_link" id="107" />    
    <class name="secondary" id="108" />
    <class name="secondary_link" id="124" />
    <class name="tertiary" id="109" />
    <class name="tertiary_link" id="125" />
    <class name="residential" id="110" />
    <class name="living_street" id="111" />
    <class name="service" id="112" />
    <class name="track" id="113" />
    <class name="pedestrian" id="114" />
    <class name="services" id="115" />
    <class name="bus_guideway" id="116" />
    <class name="path" id="117" />
    <class name="cycleway" id="118" />
    <class name="footway" id="119" />
    <class name="bridleway" id="120" />
    <class name="byway" id="121" />
    <class name="steps" id="122" />

    <class name="unclassified" id="123" />
    <class name="road" id="100" />
  </type>
  <type name="cycleway" id="2">
    <class name="lane" id="201" />
    <class name="track" id="202" />
    <class name="opposite_lane" id="203" />
    <class name="opposite" id="204" />
  </type>  
  <type name="tracktype" id="3">
    <class name="grade1" id="301" />
    <class name="grade2" id="302" />
    <class name="grade3" id="303" />
    <class name="grade4" id="304" />
    <class name="grade5" id="305" />
  </type>  
  <type name="junction" id="4">
    <class name="roundabout" id="401" />
  </type>  
</configuration>
like image 246
Denis Stephanov Avatar asked Mar 10 '23 02:03

Denis Stephanov


1 Answers

Solution is *.osm format instead of *.osm.pbf.

like image 192
Denis Stephanov Avatar answered Mar 17 '23 00:03

Denis Stephanov