Custom model for Trucks

Hello, we have received a message about deprecating the “avoid” parameters, and how we should use custom models instead.

But, it seems that the custom models are not yet supported for trucks:
“The custom model feature is available for the profiles foot, bike, scooter, car and small_truck. For other profiles you can use a specific custom model (contact us if you need help).”

So as I understand, to support trucks I would have to create a custom car profile with truck properties. Is that correct?
Where I can see the full configuration you used for the “truck” profile?

I did find some truck properties here, but it doesn’t mention other variables like speed, max_speed, etc:

Yes, we’ll support this soon. But for now you can use small_truck (or car) with additional restrictions.

One proposal is the following:

{
  "speed": [{
     "if": "true",
     "multiply_by": "0.8"
  }],
  "priority": [
    {
      "if": "hgv == NO || max_height<3.7 || max_width<2.94 || max_weight < 26 || max_length < 26",
      "multiply_by": "0.0"
    }
  ]
}

But you can improve it beyond what we currently do on our side like avoid small roads etc (this will happen soon for the public truck profile as well but we had to do some major legacy reactoring)

That sounds good for what we need. Thanks for your help.

This should work now.

1 Like

Thanks, but I tried it again and it didn’t work:
Added a custom model with truck profile and received an error response. Maybe I’m missing some configuration?

There were no changes. It still works. What kind of error did you get?

I tried again and it’s working now. May have been a mistake on my side.
Thanks for your help.