I have another question.
Are ways with traildifficulty > 4 ignored in building the graph?
Also it seems that waytype ferrata is ignored in building the graphs too.
Is it possible to activate both when building the graph by editing the options?
trail difficulty is generated from the sac scale:
sac scales abov 4 are considered rather difficult:
It is not possible to activate them during the build process. The information is saved in the graph, but the logic to use them is defined in the flagencoders:
Thanks for the information.
I read all these issues and threads before, but did not get an answer to my question from these.
So if i edit the file HikingFlagEncoder.java
and add lines to get:
suitableSacScales.addAll(Arrays.asList( "hiking", "mountain_hiking", "demanding_mountain_hiking", "alpine_hiking", "demanding_alpine_hiking", "difficult_alpine_hiking", )); preferredWayTags.addAll(Arrays.asList( "track", "path", "footway", "via_ferrata" ));
Does routing work for me after restart the web app or do i have to build graphs again?
I have tried it now.
Changed the HikingFlagEncoder.java.
Start the Docker via Compose.
But does still not route demanding_alpine_hiking ways.
Can you approve this?
Could you add the request that you tried?
Did you try it with the correct profile (foot-hiking)?
Another approach would be to adjust this function:
to always return false.
Then you should come to the same result as adding the remaining sac scales.
I have changed this function to return always false.
But routing still does not work on Ways >T4.
The file was in: var/lib/docker/overlay2/af6fe7d1ae1c37cb72c21c673c77b11cd5fbf7d90fd6fb50c0b52d5f619e87b9/diff/ors-core/openrouteservice/src/main/java/org/heigit/ors/routing/graphhopper/extensions/flagencoders/FootFlagEncoder.java
Is this the right path for the file? It is the only file on my server with this name.
Can i debug somehow if the change is working?
as far as I’m aware, the docker container doesn’t rebuild the code on restarting with docker-compose -
docker-compose build --no-cache ors-app to make sure it rebuilds.
I’m also unsure whether the graphs have to be rebuilt when changing stuff in the encoders…
As for testing whether it’s working, I’d suggest logging something in the function in question - that should at least give you some feedback to whether you are running the code you should be running
A post was split to a new topic: Problem with building ors-app with docker
I am running the ors-app with changed function.
But seems not to route T5+.
How can i log if the function is doing like i want?
Currently i am running graphs for europe, so testing is too long to wait for.
Tomorrow i will give it a try and rebuild the graphs for the alps with the changed function.
Maybe i have more luck this way.
If someone is interested here is how it works for me: (with docker-compose)
Go into your docker directory where ORS is running.
cd ORS (for example)
docker-compose down (stop and delete ors-app)
docker-compose pull (download newest version of ors-app)
Now locate FootFlagEncoder.java file in your docker.
Should be in var/lib/docker/overlay2/
Edit FootFlagEncoder.java about line 325 the function private boolean
hasTooDifficultSacScale(ReaderWay way) Change: return sacScale != null && !suitableSacScales.contains(sacScale); to: return false; //sacScale != null && !suitableSacScales.contains(sacScale);
Save the file.
Now delete the graphs folder.
And now rebuild graphs with
docker-compose up -d
In my case ORS is now routing T5+ too!
Thx for supporting me to get there!
Now i got to run highway=via_ferrata too!
Even though the via_ferratas are not show on the OSM Standard map, as you can see here:
But you can route nevertheless to this path.
Just find the file FootFlagEncoder.java
and edit about line 130. Add the line “via_ferrata” to the given array
allowedHighwayTags.addAll(Arrays.asList( "cycleway", "unclassified", "road", "via_ferrata" ));
Then delete graphs folder an build graph again.
i’m happy that it worked out for you!
Just make sure to inform the users of your App of the waydifficulty
Of course i do so.
For T5-T6 there is an text “extreme difficult” and an additional exclamation mark sign!
I am working on via_ferrata now, because there is no sac_scale but special via_ferrata_scale what you do not offer as extra_info.