Custom_model, disable speed mode

Hi there,

I’m trying to apply some changes on custom profile per request like speed using:

curl -s -X POST "http://localhost:8989/route?ch.disable=true&lm.disable=true" -H "Content-Type: application/json" -d '{
  "profile": "bike2",
  "points": [[-79.485863, 43.657139],[-79.465264, 43.687931]],
  "custom_model": {
    "speed": [{"if": "true", "multiply_by": 1.0}],
    "priority": [{"if": "road_class == CYCLEWAY", "multiply_by": 1.5}]
  },
  "points_encoded": false,
  "instructions": true
}'

but i got error:
{"message":"The 'custom_model' parameter is currently not supported for speed mode, you need to disable speed mode with `ch.disable=true`.

here is my config.yml:

graphhopper:
  profiles:
    - name: bike
      custom_model_files: [bike.json, bike_elevation.json]
    - name: bike2
      weighting: custom
      custom_model_files: [bike2.json]

  profiles_ch:
    - profile: bike

  profiles_lm: []

  routing:
    ch:
      disabling_allowed: true

Thanks.

Put all parameters in the JSON request body when using the POST request.

I think all parameters are in the JSON request body. I updated the full request.

Everything, including “ch.disabled”: true needs to be in the JSON request body too.

1 Like

Yes it worked! Thank you!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.