Overcome LM routing limitations (cross continents)

I just had an idea how we could overcome the limitation of LM that routing across certain borders is not possible.

This would require to have the SpatialRuleLookup of the LM Preparation to be available during runtime. We could lookup the id for every requested waypoint. If the id changes and ch.disable was requested we could automatically disable LM.

WDYT? Does that make sense?

1 Like

Ah, this is actual very easy, we just have to return false here instead of throwing an exception and the approximation will fall back to distance approximation. But not sure if this is wise as cross continental routes are long and A* will take much longer, so the fallback in this case might be not desired (and should only be done if lmAlgoDecorator.isDisablingAllowed()==true)

Yes this should be only done if lmAlgoDecorator.isDisablingAllowed()==true. I was just worried that if someone lives close to one of our cutted borders and tries to route across that border that there will be a weird exception. In this case our regular non_ch limitations would be enforced, like the max nodes.

BTW: Something else we should discuss is the adoption of some parameters, like: routing.non_ch.max_waypoint_distance. This is currently enforced for LM and flexible mode, maybe we should think about splitting this parameter to LM and FLEX or maybe only enforce it for the flex mode as LM should be fast enoug?

The exception should be identical to the one where one tries to route between two non connected islands

maybe we should think about splitting this parameter to LM and FLEX or maybe only enforce it for the flex mode as LM should be fast enoug?

Not sure. If one does not allow disabling LM you do not need two parameters. BTW: there might be a bug that when the request contains algorithm=dijkstra and even if LM is not allowed to be disabled that still the normal Dijkstra is used.

Exactly, but isn’t that a weird exception, because there is a connection?

Fair enough :slight_smile:, but if you allow disabling LM it might be worthwhile. For me the only reason to disable LM would be to overcome the routing limitation?

Yes, maybe we need some more specific exception.

For me the only reason to disable LM would be to overcome the routing limitation?

Hmmh, maybe we need to find a better solution if this turns out to be a frequent limitation that is often hit.

1 Like