How to build a BusFlagEncoder

I am currently planning to build a busFlagEncoder by my selves, but I found there is one problem that I cannot figure out a solution, that is: how to ensure that the start point and the end point can only be the bus stops? For example, if the start point is set to be some place in the road but is some distance away from the bus stop, the right bus navigation route should start from the bus stop instead of directly starting from the current start point. Thanks for any instruction on this problem.

Normally you would have to mark the nodes with a special information and then pass a filter to the LocationIndex, but this index currently has the limitation of being able to only accept an EdgeFilter, so you would need to mark the adjacent edges with this “bus stop” information. See here for the issue: https://github.com/graphhopper/graphhopper/issues/888