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

Support multiple values for the same OSM tag #123

Merged
merged 1 commit into from
Mar 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
added support for multiple values of one tag
  • Loading branch information
ialokim committed Feb 27, 2018
commit b389d04d113c7986324a70f640381d3fa94a03d5
6 changes: 5 additions & 1 deletion osm2gtfs/core/osm_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def __init__(self, config):
# tags from config file for querying
self.tags = ''
for key, value in self.config["query"].get("tags", {}).iteritems():
self.tags += unicode('["' + key + '" = "' + value + '"]')
if isinstance(value, list):
value = '^' + '$|^'.join(value) + '$'
self.tags += unicode('["' + key + '" ~ "' + value + '"]')
else:
self.tags += unicode('["' + key + '" = "' + value + '"]')
if not self.tags:
# fallback
self.tags = '["public_transport:version" = "2"]'
Expand Down