GHRequest request = new GHRequest().setProfile("custom_veh");
Is this correct implementation or am I confusing something?
My Graphhopper setup;
graphHopper = new GraphHopper()
new Profile("rural").setVehicle("motorcycle").setWeighting("fastest").setTurnCosts(true).putHint("u_turn_costs", 3),
new CustomProfile("custom_veh").setCustomModel(new CustomModel()).setVehicle("foot"))
The custom_model parameter cannot be used for a CH query, yes. But you can still define your custom model in the config.yml (i.e. on the server side) and use this for CH preparation.
I.e. you play around with your custom model until it fits your needs and then you can make it very fast via putting it into a CH preparation. (If you want to make the custom model only faster and still keep most of its flexibility you can use an LM preparation instead.)
So CH custom profiles are customized at graph creation and LM custom profiles are customized at request creation allowing greater flexibility.
This is really helpful as I can have really fast specific profiles setup but also have a couple of customizable profiles within my project that users can adjust without rebuilding the graph.
Also, just to tie it all off;
Forcing curbside and uturn costs using CH;
Creating the Graph using van profile new CustomProfile("van").setCustomModel(new CustomModel(getModel())).setVehicle("car").setTurnCosts(true).putHint("u_turn_costs", 3)
Then on each request; List<String> CURBSIDES = new ArrayList<>(Arrays.asList("left", "left")); new GHRequest().setProfile("van").setCurbsides(CURBSIDES).putHint(Parameters.Routing.FORCE_CURBSIDE, false);
The custom profiles are used directly “as they are” for CH and LM preparation. But the difference then is for the query: the LM algorithm allows further customization and CH does not allow further customization per request.