I have created a new EncodedValue called routing_priority. When I print out the routing_priority for my data, the correct values are displayed and everything seems to be working.
However, when I play around with the custom model values and the priority values for each routing_priority, the routes stay the same. Please see the screenshots below of my Config.yml, custom model .json file and a screenshot of the GraphHopper web interface.
I’m not quite sure, but it’s because when you define custom model json file and run the graphhopper with that file, then web interface tweaking became obsolete, that ain’t gonna work. I’ve experienced that sometimes ago. I’m not sure if that is a feature or bug.
In GraphHopper version 4 I am able to define a custom model .json file with certain encoded_values (for example, track_type) and then subsequently tweak that encoded_value in the web interface. See the example below.
This is the route when I define the following priority values for track_type in the config.yml (on the right):
Note that you can enable ‘local mvt’ in the layers menu of the web UI to inspect the encoded values for the single edges. You can also add your EV to the PathDetailsBuilderFactory so you can see your encoded value as path detail for debugging.
Thanks for the information @easbar . I am not sure which one of these suggestion I should try. Which one would you recommend? I have added my routing_priority encoded_value to the DefaultTagParserFactory.java and PathDetailsBuilderFactory.java
I start GH using the server command.
For some reason ‘local mvt’ is greyed out by me and I can’t select it.
Ok that should work since you are using the server command. So it probably must be something else that goes wrong. To use ‘Local MVT’ you a) need to zoom in far enough and b) set web.mvt.enabled: true in your config.
Thanks for the suggestion for ‘local mvt’. It is working when I zoom in. What is interesting that it is showing only these four encoded_values, even though I have a lot more specified in my config.yml. It is also showing max_speed = infinity. Why would this be the case?
Maybe @rilusmahmud is right. Did you try with an empty custom model server-side (data folder deletion & reimport required) or with an “extreme” value in the custom model (in the UI) e.g. exclude certain edges with routing_priority==0?
Okay, I can see the differences, but maybe there’s a silly quark or feature that got right there in the web interface. In the web interface, you have to maintain the same pattern as the custom model JSON file, and then it works. Otherwise, it remains the same as per the custom mode defined earlier. Then again, as @karussell mentioned earlier, the question remained for data folder deletion & reimport required.
I do not want to hardcode all routing_priorityEnc values to 5. Each road segment has each own value ranging from 0 to 4. I want to display and use these routing_priorityEnc values for each road segment. From the screenshot below, it seems I have indeed hardcoded routing_priorityEnc to 5 for all roads .
Should I remove “int routing_priorityCount = 5”? My java knowledge is very beginner