I’ve been trying to implement a custom vehicule profile with custom spatial rules.
So far I haven’t managed to do so.
I’m under the impression that this is not currently supported but I haven’t been able to confirm it for sure.
I’ve successfully created and linked my custom vehicule profile based on the car profile. It’s essentially the same thing as the car one except it penalizes speed on a way based on the number of tower nodes of the given way. I can run the service and get results using this profile (mainly the isochrone API).
Now this profile has some country-specific road speeds. I’m working on South Korea and European data at the moment and the road speeds differ from one country to another, so I tried to add a spatial rule for one of the country to try it out.
I’ve tried both the ALT and the CH algorithm without success.
The ALT algorithm uses some geoshapes that are defined in core/src/main/resources/com/graphhopper/routing/lm/map.geo.json
which are not the country shapes. I could not find documentation about it in [https://github.com/graphhopper/graphhopper/blob/d6f14bc7b42e647d7402f3551a03c38f50fe539d/docs/core/spatial-rules.md](the spatial rules doc).
I had to modify certain part of the code to get it “working” as well as use the prepare.lm.split_area_location: core/files/spatialrules/countries.geo.json
flag in the configuration about which I haven’t found documentation either.
Now I’m at the point where the service works, but the results I get with and without the spatial rules are identical. I’m under the impression that the DataFlagEncoder
is an encoder that is separate from the vehicule encoders and that they cannot be used together.
I was thinking that the spatial rules would override the configuration of my vehicule encoder but it doesn’t seem to work this way.
I’ve been able to use the spatial rules on their own with the generic
profile but what I wish for is to use them with my custom profile.
Is that possible or I am trying to do something very wrong and absurd ?