Skip to content

Commit

Permalink
OVERPASS_KEY --> GEOFABRIK_OVERPASS_KEY
Browse files Browse the repository at this point in the history
Changing environment variable name and adding functionality for the new setup script name.
  • Loading branch information
nataliejschultz committed Jun 25, 2024
1 parent 243742f commit 02f8e54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-overpass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
# Runs TestOverpass.py to check for API functionality
- name: Test Overpass
env:
OVERPASS_KEY: '${{ secrets.OVERPASS_API }}'
GEOFABRIK_OVERPASS_KEY: '${{ secrets.OVERPASS_API }}'
run: |
echo Testing overpass!
chmod +x emission/individual_tests/setup_overpass_tests.sh
./emission/individual_tests/setup_overpass_tests.sh
chmod +x emission/individual_tests/setup_and_test_overpass.sh
./emission/individual_tests/setup_and_test_overpass.sh
4 changes: 2 additions & 2 deletions emission/individual_tests/TestOverpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import logging

#Set up query
OVERPASS_KEY = os.environ.get("OVERPASS_KEY")
GEOFABRIK_OVERPASS_KEY = os.environ.get("GEOFABRIK_OVERPASS_KEY")

#Sample loc1 = NREL East Gate
loc1 = {'coordinates': [-105.16844103184974, 39.740428870224605]}
Expand All @@ -29,7 +29,7 @@ def setUp(self):
sample_data = '[out:json][bbox];way[amenity=parking];out;&bbox=-122.1111238,37.4142118,-122.1055791,37.4187945'
call_base = 'api/interpreter?data='
self.public_url_base = 'https://lz4.overpass-api.de/'+ call_base + sample_data
self.gfbk_url_base = 'https://overpass.geofabrik.de/' + OVERPASS_KEY + '/' + call_base + sample_data
self.gfbk_url_base = 'https://overpass.geofabrik.de/' + GEOFABRIK_OVERPASS_KEY + '/' + call_base + sample_data

def test_overpass(self):
r_gfbk = requests.get(self.gfbk_url_base)
Expand Down
4 changes: 2 additions & 2 deletions emission/net/ext_service/transit_matching/match_stops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import time

try:
OVERPASS_KEY = os.environ.get("OVERPASS_KEY")
url = 'https://overpass.geofabrik.de/' + OVERPASS_KEY + '/'
GEOFABRIK_OVERPASS_KEY = os.environ.get("GEOFABRIK_OVERPASS_KEY")
url = 'https://overpass.geofabrik.de/' + GEOFABRIK_OVERPASS_KEY + '/'
print("overpass configured")
except:
print("overpass not configured, falling back to public overpass api")
Expand Down

0 comments on commit 02f8e54

Please sign in to comment.