[GraphHopper] Extract a single edge?

Peter K peathal at yahoo.de
Fri Dec 20 13:29:07 UTC 2013


Can you check if a route through the streets get the street names? If
yes, then something is wrong with your code.

BTW: there is a LocationIndexSC which has the edgeFilter enable - you
should enable this shortcut filter too as you only need normal edges I
think. Also keep in mind that for now the lookup of LocationIndexTree
only grabs locations in the 8 zones around the query zone, which is
sufficient for finding the closest edge but not sure if for you.

> It is not easy to update to the latest version, since i changed
essential things to achieve my goals.

For just grabbing the neighborhood streets?


> I simply try to get all edges that are in my direct environment.

Can you disable CH? Then it should be easier

Regards,
Peter.

PS: in a future version (not pushed yet) the LocationIndexTree is better
to (mis)use for other purposes.

> 1000x Thanks!!!
>
> This solved the problem as you said:
>
> EdgeExplorer ee = graph.createEdgeExplorer(edgeFilter);
> ee.setBaseNode(nodeID);
>
> while(ee.next()){
>   resultSet.add(graph.getEdgeProps(ee.getEdge(), ee.getAdjNode()));
> }
>
>
> The only thing is that i still have no street names on all roads. I
> would have checked the OSM ways for a streetname, but in my screenshot
> you can see, that some edges are purple which means that it has a name
> and doesn't has a name at the same time!
>
> > what are you trying to solve? I'm not sure I can follow you as this
> all is already implemented in GraphHopper ...
> I simply try to get all edges that are in my direct environment.
>
> > Using the latest version would give you GPS exact results and we
> make sure no other (already solved) problems are involved.
> It is not easy to update to the latest version, since i changed
> essential things to achieve my goals.
>
> Regards,
> Andreas
>
>
> 2013/12/16 Peter K <peathal at yahoo.de <mailto:peathal at yahoo.de>>
>
>
>     > Maybe i understand the problem... Could it be that an edge explorer
>     > only iterates over edges of which the base node is the base node?
>     > Makes sense somehow.
>     > Now is the problem: How can i find an edge to which a given node is
>     > the adjacent node?
>
>     Not sure if I understand completely. Maybe the problem you are
>     having is
>     that with CH a node is only connected to nodes with a higher level but
>     still you should get all edges. And since you don't want shortcut
>     edges
>     this cannot be the problem. Hmmh.
>
>     Or maybe the API is unclear? 'base' and 'adjacent' node is
>     dependent of
>     how you traverse the graph, not e.g. if this direction is
>     accessible for
>     car. E.g. if you have a simple graph '1-2-3' and you do
>
>     iter = explorer.setBaseNode(1)
>     while(iter.next()) {
>         edgeIds.add(iter.getEdge());
>     }
>     => you'll only get one edge id with adjacent node '2'
>
>     iter = explorer.setBaseNode(2)
>     while(iter.next()) {
>         edgeIds.add(iter.getEdge());
>     }
>     => you'll get two edge ids with adjacent node '1' and '3' where the
>     order is not defined
>
>     Regards,
>     Peter.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20131220/d3d46f4d/attachment.html>


More information about the GraphHopper mailing list