[GraphHopper] Replacement for the GHUtility.getCar* methods

Peter K peathal at yahoo.de
Wed Apr 17 14:03:01 UTC 2013


Hi Adam,

yes, this is the way to go. Just define a static EdgeFilter somewhere:
OUT = new DefaultEdgeFilter(new CarFlagEncoder(), false, true)
and do
graph.getEdges(node, OUT)

Or create a helper method for it. I removed those helper methods from
graphhopper as I don't want to focus graphhopper too much on car-usage.
And so, I would've to remove them or add them for foot, bike, etc ... a
bit too much I thought and what if we later on create multi-modal routing?

Of course some months ago this was easier via getOutgoing/getIncoming
but now it isn't that much harder but a lot more flexible (e.g. you can
combine filters and create custom ones). And a filter like "incoming"
really depends on the vehicle.

Regards,
Peter.

> (See https://github.com/graphhopper/graphhopper/commit/439ccf4d754fdf33aa7fba193e844acf240282b5#commitcomment-2934782 )
>
> Before we had getOutgoing and getIncoming methods to return the
> incoming and outgoing edges of a node.
>
> These were replaced by the GHUtility.getCar* methods. Since these have
> been removed, is there an easy way to do the same thing?
>
> The simplest idea I have so far is
>
> graph.getEdges(node, new DefaultEdgeFilter(new CarFlagEncoder(),
> false, true));
>
> but this seems rather complicated.
>
> Adam




More information about the GraphHopper mailing list