Whilst my graph built fine previously, when I changed the config.yml file to support turn restrictions I now have " encoded values not matching", is this a version issue or something else and how do I determine where the issue is ?
Here’s what I’ve done ( all I want is my app to recognise turn restrictions)
In my config.yml file I have
graph.flag_encoders: car
graph.flag_encoders: car|turn_costs=true
graph.encoded_values: road_class,road_class_link,road_environment,max_speed,road_access
graph.bytes_for_flags: 4
prepare.ch.weightings: fastest
prepare.ch.edge_based: edge_or_node
prepare.min_network_size: 200
prepare.min_one_way_network_size: 200
routing.non_ch.max_waypoint_distance: 1000000
graph.dataaccess: RAM_STORE
in my my mainActivity Java Ive changed the following code
in function - " LOADGRAPHSTORAGE
GraphHopper tmpHopp = new GraphHopper().forMobile();
//**************************************************************SET-UP
tmpHopp.setCHEnabled(true);
tmpHopp.setEncodingManager(EncodingManager.create(“car|turn_costs=true”));
protected PathWrapper doInBackground(Void… v) {
StopWatch sw = new StopWatch().start();
//*******************************************************************REQUEST
GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon).
setWeighting(“fastest”).
setVehicle(“car”).
setAlgorithm(Algorithms.DIJKSTRA_BI);
req.getHints().
put(Routing.INSTRUCTIONS, “true”);
GHResponse resp = hopper.route(req);
Prior to building a graph I’ve deleted the jar files in AndroidStudioProjects\ghtrial\graphhopper\web\target
deleted the old -gh folder containing old graphs in AndroidStudioProjects\ghtrial\graphhopper
deleted files on phone under /storage/emulated/0/Download/graphhopper/maps/new-zealand-latest-gh/
I then built the graph with
$ ./graphhopper.sh -a import -i new-zealand-latest.osm.pbf
The map shows fine but I seem to have an error with
An error happened while creating graph:Encoded values do not match:
Graphhopper config: road_access|version=1732466967|bits=4|index=0|shift=0|store_both_directions=false,max_speed|version=925318033|bits=5|index=0|shift=4|store_both_directions=true,road_environment|version=-330907635|bits=3|index=0|shift=14|store_both_directions=false,road_class_link|version=150464194|bits=1|index=0|shift=17|store_both_directions=false,road_class|version=123992615|bits=5|index=0|shift=18|store_both_directions=false,roundabout|version=544120317|bits=1|index=0|shift=23|store_both_directions=false
Graph: road_class|version=887801716|bits=5|index=0|shift=0|store_both_directions=false,road_class_link|version=146044462|bits=1|index=0|shift=5|store_both_directions=false,road_environment|version=-448080443|bits=3|index=0|shift=6|store_both_directions=false,max_speed|version=2003990561|bits=5|index=0|shift=9|store_both_directions=true,road_access|version=717676379|bits=4|index=0|shift=19|store_both_directions=false,roundabout|version=544120317|bits=1|index=0|shift=23|store_both_directions=false
Change configuration to match the graph or delete /storage/emulated/0/Download/graphhopper/maps/new-zealand-latest-gh/