GraphHopper.com | Forum | GitHub | Maps | Blog

How to Declare a Non-stop Way


#1

I am working with ski lift (type=“aerialway”) and have developed a new FlagEncoder.
Lets consider a specific way as follows for which I am currently working with:

<way id="45765579" version="5" timestamp="2014-08-06T10:26:38Z" changeset="24572634" uid="362997" user="Virgile1994">
	<nd ref="582825823"/>
	<nd ref="582825822"/>
	<tag k="name" v="TSD de la Bérangère"/>
	<tag k="aerialway" v="chair_lift"/>
</way>

In the above defined way (ski lift), there are two nodes which are situated at the start of the lift (starting lift station) and at the end of the lift (end lift station). The ski lift does not stop in between.

The problem is that as shown in this FIGURE, when I try to get a route from one point on the way (at some distance after the start of way) to another point on the way (at some distance before the end of way), the GraphHopper gives the route exactly from starting point to the ending point. But it is not realistic in the case of ski lift because the lift does not stop anywhere except starting and ending points.

What I want is that GraphHopper should give a route from start of the way (starting point of ski lift) to end of the way (ending point of ski lift) and the users should cover the remaining distance by themselves.

In short, I want to declare a non-stop way. How can I achieve this declaration of non-stop way in GraphHopper?

Thank you in advance.

Best Regards,
Yasir


#2

Have a look at this topic.


#3

Thank you but this topic seems different than what I want to do.

In my case, the GraphHopper is selecting the correct way (ski lift), but I want that instead of providing the route from starting point to ending point, the GraphHopper should provide a route from start of the way (starting node) to end of the way (ending node). Then the user should walk to the starting node and ending node by himself/herself.

As show in this figure, the GraphHopper is providing a route from point B to C. But I want that GraphHopper should provide a route from point A to D.

Here is the scenario which I want to achieve: The user should first walk from point B to A. Then it should follow the suggested route by GraphHopper and go from point A to D. Then finally, he/she should walk again from point D to B to reach its desired place.

Best Regards,
Yasir


#4

Ok, if the walking is not part of the route, then my proposed solution might not be what you are looking for.

There are different things that you could try:

  • Change the ViaPointRoutingTemplate to use base and adjacent nodes, instead of closest
  • Change the LocationIndex

You also might run into virtual edge issues and maybe need to disable virtual edges.

I never did this so I don’t know if there might be other issues.

Cheers,
Robin


#5

Thank you Robin for your response and help. I was trying to do as you mentioned but it seems that I am a bit lost.

  1. Can you please inform me more about a specific direction that where and how can I find and change “ViaPointRoutingTemplate” and “LocationIndex”? as well as virtual edges issues?

  2. Can you please inform me that why GraphHopper picks in-between location (non nodes) on a way (i.e., points ‘B’ and ‘C’ in this figure), instead of selecting location which are nodes on a way (i.e., points ‘A’ and ‘D’ in this figure) while recommending a route?

Thanks in advance.

Best Regards,
Yasir


#6

Also, in other words, how can I treat and model a way like an elevator or a lift which has fixed stops (i.e., it does not allow to exit in the middle)? and how can I do routing for this?


#7

Hi Yasir,

sorry as I said, I never did this. I recommend debugging into either the com.graphhopper.routing.template.ViaRoutingTemplate#lookup and #calcPaths and com.graphhopper.storage.index.LocationIndexTree#findClosest. As I said, I would try to use base and adjacent nodes.

I cannot open your images, please upload them here in the forum, but this sounds like VirtualEdges.

Please see my answers above. GraphHopper usually doesn’t work like this, so you have to build this, it’s not a small config file change.

Cheers,
Robin


#8

Many thanks Robin for your response and informing me ViaRoutingTemplate, calcPaths and findClosest. I am now currently exploring them and tyring to change them.

In fact, the most relevant use case related to my scneario is “bus” where we have bus stations and a person must need to go to the nearest bus stop in order to get the bus.
I found a topic of developing a BusFlagEncoder here:
I followed it but could not catch it well. Do you have any idea about it?

Many thanks,
Yasir


#9

The proposed solution is to creat a NodeFitler instead of an EdgeFilter and to use itin the LocationIndex instead, also see this issue. A PR for this feature would be highly appreciated as well :).

Cheers,
Robin


#10

Hi Robin,

Thank you for your directing me.
I was trying to understand EdgeFilter, LocationIndex, EdgeExplorer and how closestMatch is performing but I am unable to understand them properly.

  1. Is there any documentation or something from where I can understand these things (e.g., EdgeFilter, LocationIndex, EdgeExplorere and closestMatch)? so that I can start developing a new NodeFilter?

  2. For creating a NodeFilter, can you please list what should be the required steps to create it? Atleast these steps will give me a direction to go towards, and I will then try to implement NodeFilter in GH.

Many thanks.
Yasir


How to Develop a NodeFilter to find route comprised of nearest node instead of nearest edge
#11

Hi Yasir,

Please have a look at the official documentation and at the interfaces each of these classes implement (usually the interface contains quite some documentation). If you find classes that miss documentation, where it would be required, please feel free to create a PR adding documentation :).

Mhm, I never did this, so I cannot give you any details here. I would probably look at how the EdgeFilter is used and try to create something similar for Nodes. If possible I would try to create a common interface for both (not sure if this is possible, it might not be possible). I would debug trough the code, look what happens.

Cheers,
Robin


#12

Hi Robin,

Many thanks for your response and providing the documentations link and a starting point of investigation of EdgeFIlter for developing NodeFilter.
Many thanks to you also for debugging the code and looking into this matter.

Perfect, I will create a new topic if any documentation is missing, as well as I am also going to create a new topic for creating NodeFilter.

Best Regards,
Yasir