-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support multiple values for the same OSM tag #123
Conversation
Looks good to me, but haven't run the code myself. Have you tried it with special characters, like |
It should work as before, the unicode handling isn't changed by this PR. So yes, special characters should be supported as before. |
osm2gtfs/core/osm_connector.py
Outdated
self.tags += unicode('["' + key + '" = "' + value + '"]') | ||
if isinstance(value, list): | ||
value = '|'.join(value) | ||
self.tags += unicode('["' + key + '" ~ "' + value + '"]') |
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.
Why do you switch to ~
?
It would work with a =
here too, and would be safer : we don't want Overpass to match regular expression and get matches that partially fit the values.
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.
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.
I've changed it accordingly and added regex anchors (^
and $
) to prevent partially matching.
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 a lot for noticing it!
I've elaborated this little code change to support a
config.json
file as follows:This generated the following Overpass query:
Fixes #110