Getting path details like road_class, road_environment, and surface

I was trying to retrieve path details like road_class, road_environment, and surface from the routing API when I got this error message

You requested the details [street_name, time, road_class] but we could only find [street_name, time]]

what should I modify to enable the retrieval of routes details?

Thanks a lot for your help!

This is currently only possible for motor vehicles like car, small_truck, truck or scooter.

Thanks for the quick reply. If I wanted to implement the functionality for a custom vehicle, where should I start from? Having a look at the car example will help?

Ah, sorry. Missed the category core. This feature is part of our enterprise edition and does not work for any vehicle of the open source core. But surely you can implement this for the open source edition using EncodedValues, indeed we did not intent to hide this feature in the enterprise edition but it was not easy to apply it for every vehicle without producing a mess … we’ll take steps to make this much easier, via config, for the open source version.

thanks for the explanation. adding the functionality via config file would be the best, in the meanwhile I was wondering if the current opensource code contains the example for the car vehicle or not. In the positive, I can give the extension for a custom vehicle a try.

Yes, you can have a look at the DataFlagEncoder on how to add certain properties to an edge and fetch them in the path details or Weighting.

Perfect, thanks!