Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.18k stars 3.29k forks source link

Getting error "There are no edges remaining after parsing" #5589

Closed iamvinayak closed 4 years ago

iamvinayak commented 4 years ago

I am trying to convert the OSM data into OSRM format using the steps documented on Wiki. However, while executing osrm-extract, I am receiving an error. Here is the output snippet of esrm-extract command. I am using the default car.lua profile which ships with OSRM profiles.

-bash-4.2$ osrm-extract Streets.osm [info] Parsed 0 location-dependent features with 0 GeoJSON polygons [info] Using script profiles/car.lua [info] Input file: Streets.osm [info] Profile: car.lua [info] Threads: 8 [info] Parsing in progress.. [info] input file generated by unknown tool [info] timestamp: n/a [info] Using profile api version 4 [info] Found 3 turn restriction tags: [info] motorcar [info] motor_vehicle [info] vehicle [info] Parse relations ... [info] Parse ways and nodes ... [info] Using profile api version 4 [info] Using profile api version 4 [info] Using profile api version 4 [info] Using profile api version 4 [info] Using profile api version 4 [info] Using profile api version 4 [info] Using profile api version 4 [info] Parsing finished after 12.0085 seconds [info] Raw input contains 245560 nodes, 182119 ways, and 0 relations, 0 restrictions terminate called after throwing an instance of 'osrm::util::exception' what(): There are no edges remaining after parsing.src/extractor/extractor.cpp:645 Aborted

iamvinayak commented 4 years ago

I am not sure how I can share the OSM file which I am using, but here is a sample WAY from my OSM file. Any insights will be helpful.

`

`

ImreSamu commented 4 years ago

Any insights will be helpful.
<way id="-245561"> , <tag k="RAMP"

imho:

danpat commented 4 years ago

Yes, @ImreSamu is right - while the data here is in OSM XML format, it is not usable by OSRM.

OSRM only understands the tagging conventions from the OSM Wiki - you cannot just make <way>s and exepect routable output. The ways must be tagged properly, according to the normal OSM scheme.

In addition, I can see that you have invalid node references:

<way id="-245561"> <nd ref="-1"/> <nd ref="-2"/> <nd ref="-3"/> <nd ref="-4"/>

Negative numbers in IDs and refs are not valid - OSRM expects these numbers to be positive.

iamvinayak commented 4 years ago

thanks @ImreSamu and @danpat. I added logging statements in LUA profile to check where the extraction process was breaking. It was due to missing OSRM specific tags like 'highway'.

I have requested my vendor to prepare the OSM file as per OSRM tags specification.