-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Return datasource names along with datasource annotation #4973
Conversation
c1c6e66
to
52eb986
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a stab at this! But we should re-consider adding a new annotation type for this. It might be easier to just add a new property to the RouteLeg
object something like datasource_name
that lists the names of the data sources if you pass annotations=datasources
. That would get around the old "many strings in vector" problem and be more consistent with the current API. Basically we only need to add the dictionary for our dictionary encoded data sources.
Ah, good idea. How about just putting it inside the
|
Yeah that could work, the only concern is that people could be confused about the fact that it behaves differently then other entries in |
@TheMarex I know, I wish we'd thought ahead and could put this under I'll put it under An alternative, maybe to try to future-proof this a bit, might be to add a
This would give us a spot to put future metadata like this so we could say "the |
52eb986
to
c9dfad4
Compare
… of the `datasources` annotation
c9dfad4
to
068e80a
Compare
datasource_names
annotation
@TheMarex I moved everything under a new |
@danpat one of the unit tests is failing:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
Issue
We currently expose the
datasources
annotation, which returns the index of the datasource as supplied with the--segment-speed-file
parameter toosrm-contract
orosrm-customize
.This PR exposes the string version of that - the actual filename (minus file extension) that was passed to
--segment-speed-file
. This is useful for getting a human readable version of the annotation, rather than needing to jump through hoops to figure out which index matches to which file supplied.The new format adds a
metadata
sub-structure, and thedatasource_names
list resides therein:Tasklist