diff --git a/amarillo/plugins/grfs_export/gtfs_export.py b/amarillo/plugins/grfs_export/gtfs_export.py index d0cee0e..2317e62 100644 --- a/amarillo/plugins/grfs_export/gtfs_export.py +++ b/amarillo/plugins/grfs_export/gtfs_export.py @@ -103,8 +103,9 @@ class GtfsExport: current_trip.route_id = current_route_id for other_id, other_trip in list(ungrouped_trips.items()): - # if an ungrouped trip is close to any of the grouped trips, add it to the route group - if (any(self.trips_are_close(other_trip, grouped_trip) for grouped_trip in current_group.values())): + # if an ungrouped trip is from the same agency close to any of the grouped trips, add it to the route group + # TODO: it should be possible to optimize this + if (any(grouped_trip.agency == other_trip.agency and self.trips_are_close(other_trip, grouped_trip) for grouped_trip in current_group.values())): current_group[other_id] = ungrouped_trips.pop(other_id) current_group[other_id].route_id = current_route_id diff --git a/pyproject.toml b/pyproject.toml index 1422f8a..182bed6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "amarillo-grfs-export" -version = "0.0.2" +version = "0.0.3" dependencies = [ "amarillo", "amarillo-enhancer",