-
Notifications
You must be signed in to change notification settings - Fork 72
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
Way ID in Route #309
Comments
Hi, From what I gathered so far, a path is calculated and eventually there's a call to Inside The questions is, how to add this kind of behavior? Creating a whole new custom route builder for such a small change does not seem to make sense. Would adding a property to That way, it will be possible to create a new instance of I'd be happy to hear thoughts/comments :-) BTW, a question about the implementation efficiency - it seems that along the program flow you have the full path including the edges. Then, this is redacted to a list of vertices and then, the edges are being looked up again in RouterDB. Isn't this "inefficient"? |
I would make sense to add these attributes to the output routes by default, same as is happening with the other attributes. Also, keep in mind that an OSM way can span multiple edges: https://www.openstreetmap.org/way/28859745#map=18/51.21550/3.07210 => this id is not unique per edge in the routing network. I would accept a pull request for this, it should be fairly doable to add this feature to the route builder. Ping me if you want some pointers. |
Keep in mind that if you do a pull request to keep focus on one feature and modify as little code as possible to implement it. |
Hi @xivk - thanks for getting back to me on this.
Does this makes sense? I did not fully understand your comment about way IDs not being unique in the network... Is there a unique ID that identifies a "way" (road - sorry - I am new to OSM world). Let me know how I can push this through ... |
No there is no such ID. There are way IDs and node IDs in OSM for example these: https://www.openstreetmap.org/way/28859745#map=18/51.21550/3.07210 => WAY with ID 28859745 And then Itinero uses an internal ID scheme that uses vertex IDs and edge IDs. They are different from the above way IDs and node IDs. It would be acceptable to include the way id and node id in the output route but not the internal Itinero ID because they don't have any meaning. You should be able to include attributes that exists on the edges (in EdgeMeta) in the route output. Then you would have the way id not the internal Itinero ID like you are doing here:
|
Hi, |
@xivk, would you also like the node tags to be stored? e.g. in
or something more primitive to only add a metaTags with a I think it's best to separate E.g. the same can be done in Otherwise I think it must also be added to either the default profile tags or the lua as 'id' which will be confusing I think... I think the minimum way to implement this would be as follows( For Ways:
For Nodes:
Then in
@xivk , I will include this in #302 if you give some feedback there. |
I see that this has yet to be implemented when looking at the source, but it would be really useful in my use case where I calculate speed based on density and therefore need to know where each car is located while traversing the route. Any chance on getting it in there in a near future? EDIT: I actually solved my problem by creating a hash from the last coordinate of the shape as well as the second to last coordinate to identify a "road segment", using way id is not reliable since ways can cross junctions. The solution works for most cases except for when a router point starts between the last and second to last coordinate on a shape (the hash then is different due to the second to last coordinate is the router point and not a "proper" vertex/node). |
I would be interested in this too. |
Hi,
First of - thanks for this great library. It is very easy to get started and seems very robust.
I am using the library to calculate routes and then aggregate the segments on each route.
From what I have seen in the OSM pbf format specifications, there is a (unique) ID for each node/edge (way in OSM lingo, if I am not mistaken).
I have found that it is possible to preserve the way IDs when loading the
RouterDb
by passing in aLoadSettings
withKeepWayIds = true
. I even see the relevant keys when inspecting theRouterDb
instance inEdgeData
.I was expecting that this attribute will "propagate" along when calculating a route and will appear as meta data of the ShapeMeta instances attributes but I don't see this happening.
Is there a way to get the IDs of the road/way/segments in the route, or otherwise look up this value and associate it with the route's segment?
Thanks!
The text was updated successfully, but these errors were encountered: