Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic handling of relations #681

Closed
svenluzar opened this issue Jul 27, 2013 · 6 comments
Closed

generic handling of relations #681

svenluzar opened this issue Jul 27, 2013 · 6 comments

Comments

@svenluzar
Copy link
Contributor

Hi,

I'm the technical architect and one of the developers of naviki (www.naviki.org, started in 2008, bikerouting for Europe). For naviki I implemented another routingserver. The routingserver uses also the data of OSM and an algorithm, which is similar to one of the algorithms described in the PhD Thesis of Dominik Schultes.

I evaluated OSRM during this week, and I'm impressed. Really good work! I give it a serious consideration to change our routingserver to OSRM. In some fields our routingserver is a little bit better. Currently I identify the differences between the two routingservers and I'm going to improve OSRM in that fields.

Here are three examples:

  1. In a lab-version we use elevation data
    (you also discussed the topic to use external data in Using external data (elevation, polution, traffic...) in lua profiles  #546 )
  2. We use more (and bike specific) cases in the route instructions
    (for example we can add this additional cases to OSRM)
  3. We use relations to determine weights for the edges

In this issue I want to discuss the third example. I'm going to implement a generic handling of osm-relations and I want to discuss the best way, such that the community accepts the implementation for OSRM.

The possibility to use informations from osm-relations to determine the weight for edges would be helpful in many cases. At this point an example should be given: Among other way-tag we use the osm relation route to determine the weight of an edge (http://wiki.openstreetmap.org/wiki/Relation:route).

My idea is to parse the relations in PBFParser.cpp#L117 first, store the ExtractorRelations in a vector and the mapping between the members (wayids) and the index of the relation. In contrast to ways and nodes, it's not really space intensive to store this data.

After method call ParseWayInLua at PBFParser.cpp#L314 I want to use the mapping between the members (way ids) and the index of the relation to find relations concerning the way. If such relations exist, I want to call a method ParseRelationInLua with a signature like

ParseRelationInLua(ExtractorRelation&r, ExtractionWay&w){
    ...
}

similar to Method ParseWayInLua at BaseParser.cpp#L84

After that we can use the lua file to determine the weight for an edge depending on informations from osm-relations.

Feel free to comment my proposal, such that we find the best way to implement such a feature.

@emiltin
Copy link
Contributor

emiltin commented Jul 28, 2013

hi,
at the city of copenhagen we set up a bike router at http://www.ibikecph.dk, which is also based on osrm. we're also working on apps for ios and android.

we added support for relations and pushing of bikes. the code we're using is in the 'edge' branch at https://github.com/ibikecph/Project-OSRM/tree/edge.

the way we're handling relations is to pass a list of relevant relations to to the way function, so you can use them together with other way tags. at https://github.com/ibikecph/Project-OSRM/blob/edge/profiles/bicycle.lua#L329 you can see how we use it to handle bike routes.

i think dennis is considering/working on adding support for relations to the main repo.

@DennisOSRM
Copy link
Collaborator

yes, work is underway

@emiltin
Copy link
Contributor

emiltin commented Jul 28, 2013

can you say more about 2 you mentioned above? (bikes specific cases in the route instructions)

@svenluzar
Copy link
Contributor Author

@emiltin Thanks for your great informations and helpful realization concerning list item 3 (relations to determine weights for edges). For list item 2 (bikes specific cases in the route instructions) i'm going to open a new issue.

@DennisOSRM Sounds really good, thanks for this new feature. Can you give me a forecast, when it's roughly done? Can I support you to do this work?

@svenluzar
Copy link
Contributor Author

@emiltin I opened the new issue #684 for list item 2 (bikes specific cases in the route instructions)

@DennisOSRM
Copy link
Collaborator

Duplicate to #482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants