Searching for close tower nodes

I’m working on a university group project on the subject of traffic warnings. We’re very new to Graphhopper, but we are already using it for map-matching, and we would like to use it for other functionalities as well.

To illustrate what we’re trying to do let’s take a traffic jam on a highway as an example. We receive a list of GPS points that specify the location of the traffic jam. We map-match these points using Graphhopper. Now, we want to send a traffic jam warning to every car for which it is relevant. We say a warning is relevant to a car if it is approaching the traffic jam, and avoiding it is not an option.

As a starting point, our idea is to find a list of lat/long coordinates stretching from the location of the traffic jam back to the closest junction (a tower node, I believe) before it. We’re having difficulties getting started on this problem, since this seems to be a little more low-level than normal usage. To phrase it into slightly more concrete questions:

How can we use the Graphhopper library to find the closest tower node(s) starting from a pillar node?

How can we make sure we’re looking for these tower nodes in the right direction? We want to find junctions before the traffic jam, not after it.

Is there anything else that strikes you as being interesting to us?

We would love to hear what more experienced Graphhoppers have to share with us. Thanks in advance! :slight_smile:

You can get a few hints to your questions here: GitHub - karussell/graphhopper-traffic-data-integration: [not maintained] Traffic data integration example for GraphHopper (using an old GH but lower level API should be very similar)

How can we use the Graphhopper library to find the closest tower node(s) starting from a pillar node?

For your use case you do not use pillar nodes but usually you use LocationIndexTree to get edges

How can we make sure we’re looking for these tower nodes in the right direction? We want to find junctions before the traffic jam, not after it.

You need to traverse in the correct direction. Furthermore you have to make properties direction dependent, probably best using the new PR here: Edge flags refactoring by karussell · Pull Request #1447 · graphhopper/graphhopper · GitHub