GraphHopper.com | Forum | GitHub | Maps | Blog

Public Transit and Walking


#1

Hello,

Sometimes when I use Graphhopper with GTFS I get an interesting result and was wondering if it is intentional. If I want to go from point A to point B and the best route to walk (lets say its 0.3 miles away). If I run it with pt. I get directions to walk farther away from point B just to get on a bus to take me to another stop and then walk to point A when the ideal route is just to walk from point A to point B.

Is that functionality intentional?

Thanks!

Austin


#2

Do you have the underlying OSM data imported? What was your command to start the server?


#3

Yes I import he OSM data.

To start the server I run
java -Xmx1g -Xms1g -jar graphhopper/web/target/graphhopper-web-*-with-dep.jar datareader.file=osrm/map.osm gtfs.file=tcat-ny-us.zip jetty.port=8988 jetty.resourcebase=./graphhopper/web/src/main/webapp graph.flag_encoders=pt prepare.ch.weightings=no graph.location=./graph-cache &>/dev/null &

If I change graph.flag_encoders to pt,foot would that help?

Best,

Austin


#4

Is map.osm covering the area of the gtfs? If you can link to the actual used files and let me know the two coordinates or link to the test servers this would help.


#5

Hi @karussell! Sorry for the delay.

Here is the map.osm we are using. https://github.com/cuappdev/tcat-map

The coordinates and information:
Time: 2018-03-04 15:09
Start: 42.44505,-76.479167
End: 42.445786,-76.48304

I hope this helps. In my opinion is it quicker just to walk to the location, but graphhopper suggests a route. I was wondering if this was intentional and if so, is there a way around it.

Best,

Austin


#6

We currently always (and exclusively) compute a transit trip. Transit routing is not integrated with the rest of the service yet (and uses a different algorithm). It’s currently expected that comparing the transit option with “walk only” or other modes would happen one layer above. This may change.


#7

Thanks @michaz for sharing this! So the OSM network is currently supposed to calculate just the first and last leg. Could we add an option to calculate walking transit trips on the fly or (as you are indicating) does this require a substantial change to the algorithm?


#8

It’s totally possible, and in the previous attempt, it was done, because there it was the natural thing to do. In the current implementation, it will create a slight assymetry which is why it’s currently not in.

But I totally see that it belongs in there. Will put on to-do list.


#9

Thanks for the response! What do you suggest is the best to determine if it is better to walk? I was thinking of comparing total walking distance of transit route vs walking from point a to point b.

Thoughts?

Best,

Austin