Skip to content

Commit

Permalink
Fixing broken Turkey feeds (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
yasinkaraaslan authored Aug 30, 2024
1 parent 8b1e291 commit b5eeec6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
13 changes: 6 additions & 7 deletions feeds/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
],
"sources": [
{
"name": "izmir-eshot",
"name": "izmir-eshot",
"type": "transitland-atlas",
"transitland-atlas-id": "f-eshot~tr"
},
{
"name": "izmir-metro",
"type": "transitland-atlas",
"transitland-atlas-id": "f-izmir~metro",
"fix": true
"type": "http",
"url": "https://dl.dropboxusercontent.com/scl/fi/4pq6whnox4yzunrql6xdh/izmir-metro.zip?rlkey=cy6i0qbjq4hod0d5yh4i5efmi"
},
{
"name": "izmir-izban",
Expand All @@ -31,14 +30,14 @@
{
"name": "istanbul-ibb",
"type": "http",
"url": "https://s3.gtfs.pro/files/uran/improved-gtfs-ibb-istanbul.zip",
"url": "https://dl.dropboxusercontent.com/scl/fi/v937qi0xnytzl21a3bbd0/istanbul-ibb.zip?rlkey=dgi6l0cxb2203fresf1s16r7i",
"fix": true
},
{
"name": "istanbul-iett",
"type": "http",
"url": "https://s3.gtfs.pro/files/sourcedata/iett.zip",
"fix": true
"url": "https://dl.dropboxusercontent.com/scl/fi/t57vx1ivwq02x0xy51tum/istanbul-iett.zip?rlkey=qb0ien7ba5s2okt3or2lzc2nn",
"drop-too-fast-trips": false
},
{
"name": "konya",
Expand Down
4 changes: 3 additions & 1 deletion src/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,14 @@ def postprocess(self, source: Source,

command = ["gtfsclean", str(temp_file),
"--fix-zip",
"--check-null-coords", "--drop-too-fast-trips",
"--check-null-coords",
"--empty-agency-url-repl", "https://transitous.org",
"--remove-red-routes", "--remove-red-services", "--remove-red-stops", "--remove-red-trips", "--red-trips-fuzzy",
"--output", str(temp_file)]
if source.fix:
command.append("--fix")
if source.drop_too_fast_trips:
command.append("--drop-too-fast-trips")

subprocess.check_call(command)

Expand Down
3 changes: 3 additions & 0 deletions src/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Source:
skip: bool = False
skip_reason: str = ""
function: Optional[str] = None
drop_too_fast_trips: bool = True

def __init__(self, parsed: Optional[dict] = None):
self.license = License()
Expand All @@ -54,6 +55,8 @@ def __init__(self, parsed: Optional[dict] = None):
self.skip_reason = parsed["skip-reason"]
if "function" in parsed:
self.function = parsed["function"]
if "drop-too-fast-trips" in parsed:
self.drop_too_fast_trips = parsed["drop-too-fast-trips"]


class HttpOptions:
Expand Down

0 comments on commit b5eeec6

Please sign in to comment.