diff --git a/subway_structure.py b/subway_structure.py index 3f1c7bb..b9e4b97 100644 --- a/subway_structure.py +++ b/subway_structure.py @@ -1108,8 +1108,13 @@ class City: if len(variant) < 2: continue # Using transfer ids because a train can arrive at different stations within a transfer - t = (variant[0].stoparea.transfer or variant[0].stoparea.id, - variant[-1].stoparea.transfer or variant[-1].stoparea.id) + # But disregard transfer that may give an impression of a circular route + # (for example, Simonis / Elisabeth station and route 2 in Brussels) + if variant[0].stoparea.transfer == variant[-1].stoparea.transfer: + t = (variant[0].stoparea.id, variant[-1].stoparea.id) + else: + t = (variant[0].stoparea.transfer or variant[0].stoparea.id, + variant[-1].stoparea.transfer or variant[-1].stoparea.id) if t in variants: continue variants[t] = variant.element