diff --git a/emission/net/ext_service/transit_matching/match_stops.py b/emission/net/ext_service/transit_matching/match_stops.py index d08505e9e..41d9dc80c 100644 --- a/emission/net/ext_service/transit_matching/match_stops.py +++ b/emission/net/ext_service/transit_matching/match_stops.py @@ -3,14 +3,16 @@ import requests import attrdict as ad import itertools -import copy +import os import time try: - config_file = open('conf/net/ext_service/overpass_server.json') + OVERPASS_KEY = os.environ.get("OVERPASS_KEY") + url = 'http://overpass.geofabrik.de/' + OVERPASS_KEY + '/' + print("overpass configured") except: print("overpass not configured, falling back to default overleaf.de") - config_file = open('conf/net/ext_service/overpass_server.json.sample') + url = "https://lz4.overpass-api.de/" try: query_file = open('conf/net/ext_service/overpass_transit_stops_query_template') @@ -18,9 +20,6 @@ print("transit stops query not configured, falling back to default") query_file = open('conf/net/ext_service/overpass_transit_stops_query_template.sample') -config_data = json.load(config_file) -url = config_data["url"] - query_string = "".join(query_file.readlines()) RETRY = -1