Footway route navigation does not work

I am a Graphhoper newbie. I want to make a demo, but I have some problems. Can anyone help me?

My scenario is as follows:
1、 Clone and switch branches
git clone git@github.com:graphhopper/graphhopper.git
git checkout 10.0

2、Export osm file from openstreetmap as data source for demo

3、Use JOSM to edit osm (add a footway) and export pbf


I didn’t upload it to osm after editing because I just wanted to test it locally

4、Place pbf in the root directory of the graphhoper project and modify config-example.yml
datareader.file: “demo-latest.osm.pbf”

5、Startup error: Invalid OSM WAY Id: -1249; Ids must not be negative,I’ve temporarily commented it out to start the service

6、Visit localhost:8989, enter the newly added footway starting point, but the navigation route you get is not the expected walking route,I expect to get the red route

I have a few questions:

  1. Does the edited osm need to be uploaded to the osm server for the route to take effect?
  2. Does the above situation require additional configuration to support?
  3. Does the osm route need to add additional tags to support?

Thank you very much for your answers

See discussion: validate that ids are not negative by lukasalexanderweber · Pull Request #2652 · graphhopper/graphhopper · GitHub

And better use the script replace_invalid_osm_ids.py mentioned there.

Yes, I tried this Python script, and it works, but I don’t think it’s the most optimal solution. However, the route is still incorrect.

As you noticed ways added in JOSM will be assigned negative OSM IDs, that GraphHopper does not handle. If you comment out the code that checks for positive IDs in GraphHopper you will run into all sorts of trouble, so don’t do it unless you know exactly what you are doing.

Luckily this problem was addressed already by the script mentioned above, which converts the negative IDs to positive ones, so you should use it (without any further changes to GraphHopper).

Note that once you change the OSM file and run the server again you need to delete the graph folder to trigger a new import.

If you only add a single way to the file that is not connected to the remaining ways on your map it might be filtered out by GraphHopper. To disable this mechanism you would have to set prepare.min_network_size: 0 in your config file (and run a new import).

No.

Tagging it as highway=footway should be sufficient.