The only way I can think of is not available (yet?)
That would be detecting the nearest preferred path node, but Get/SetPathNodePreferred has not been implemented yet (it is in the wish list, thou).
But this function would be limited to the surrounding loaded cells, anyway (about 150 meter radius).