-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Profile: Access highway=
key in segment function
#6145
Comments
As the extraction is currently constructed this will be difficult, the OSM tag context has been discarded by the time the extraction reaches Just to understand correctly, you want to disproportionately apply a slope to the speed of a segment depending on the highway type? |
Exactly, this is what I was trying to achieve.
So any information related to the way, for example, the way_id is no longer available in the |
Had a deeper look.
osrm-backend/src/extractor/extraction_containers.cpp Lines 439 to 440 in 41dda32
At this point, it's iterating over a list of These internal edges are actually created when processing the output of osrm-backend/src/extractor/extractor_callbacks.cpp Lines 405 to 430 in 41dda32
So it looks like the edge already has access to the OSM segment nodes, and a guidance classification that is almost a complete list of OSM highway types. osrm-backend/profiles/lib/guidance.lua Lines 6 to 27 in f7478ba
Could this list be sufficient for your calculations? We could also add the OSM way ID to the internal edge representation and pass that through instead. Either way, there's a bit of additional plumbing required to pass these values through to |
Thank you for pointing out these code snippets.
For my case, it would be ideal to pass the
I do understand that this would cause quite some memory bloat, especially for users who do not use this feature - which is probably the vast majority. |
Yes, I think we can add the way ID to |
This issue seems to be stale. It will be closed in 30 days if no further activity occurs. |
Within the
process_way()
function in a profile, it is possible to obtain relevant keys using, e.g.,way:get_value_by_key('highway')
.Is there a similar possibility to do so for the segment function?
I have used a modified version of the
rasterbot.lua
profile to include third-party raster elevation data and would like the slope of a segment to affect duration conditional on the surface or road type.For example, the same slope should assign a higher penalty on ways with
highway=track
than onhighway=primary
.However, keys/tags such as
highway=primary
are not listed among the available attributes in theprocess_segment()
function, as described in profiles.md.As far as I understand, the segments are subsets or parts of the ways, so the information specific to each way should be available for the segment somehow?
The text was updated successfully, but these errors were encountered: