Skip to content

Commit

Permalink
Patch co-operated route with different number of stops
Browse files Browse the repository at this point in the history
  • Loading branch information
chunlaw committed Jan 9, 2025
1 parent bca3034 commit 727c19a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crawling/mergeRoutes.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def importRouteListJson( co ):

for _route in _routeList:
found = False
speicalType = 1
orig = {'en': _route['orig_en'].replace('/', '/'), 'zh': _route['orig_tc'].replace('/', '/')}
dest = {'en': _route['dest_en'].replace('/', '/'), 'zh': _route['dest_tc'].replace('/', '/')}

Expand All @@ -76,13 +77,17 @@ def importRouteListJson( co ):
found = True
route['stops'].append((co, _route['stops']))
route['bound'][co] = _route['bound']

elif _route['orig_en'].upper() == route['orig']['en'].upper() and _route['dest_en'].upper() == route['dest']['en'].upper():
speicalType = int(route['serviceType']) + 1
if _route["route"] == '606' and _route['dest_tc'].startswith("彩雲"):
print("Yes", speicalType)

if not found:
routeList.append(
getRouteObj(
route = _route['route'],
co = _route['co'],
serviceType = _route.get('service_type', 1),
serviceType = _route.get('service_type', speicalType),
stops = [(co, _route['stops'])],
bound = {co: _route['bound']},
orig = orig,
Expand Down

0 comments on commit 727c19a

Please sign in to comment.