Added route_color and route_text_color
This commit is contained in:
parent
174f3a4a2f
commit
fdb36da9de
|
|
@ -135,9 +135,9 @@ class GtfsExport:
|
|||
#if there is only one agency, use that
|
||||
agencies = set(trip.agency for id, trip in route_group.items())
|
||||
if len(agencies) == 1: agency = agencies.pop()
|
||||
trip = next(iter(route_group.values())) # grab any trip, relevant values should be the same
|
||||
trip : Trip = next(iter(route_group.values())) # grab any trip, relevant values should be the same
|
||||
|
||||
self.routes.append(self._create_route(agency, trip.route_id, trip.route_name))
|
||||
self.routes.append(self._create_route(agency, trip.route_id, trip.route_name, trip.route_color, trip.route_text_color))
|
||||
|
||||
def _convert_trip(self, trip: Trip):
|
||||
self.trip_counter += 1
|
||||
|
|
@ -193,8 +193,8 @@ class GtfsExport:
|
|||
logger.exception(ex)
|
||||
return destination
|
||||
|
||||
def _create_route(self, agency, route_id, long_name):
|
||||
return GtfsRoute(agency, route_id, long_name, RIDESHARING_ROUTE_TYPE, "")
|
||||
def _create_route(self, agency, route_id, long_name, color, text_color):
|
||||
return GtfsRoute(agency, route_id, long_name, RIDESHARING_ROUTE_TYPE, "", color, text_color)
|
||||
|
||||
def _create_calendar(self, trip):
|
||||
# TODO currently, calendar is not provided by Fahrgemeinschaft.de interface.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from datetime import timedelta
|
|||
|
||||
GtfsFeedInfo = namedtuple('GtfsFeedInfo', 'feed_id feed_publisher_name feed_publisher_url feed_lang feed_version')
|
||||
GtfsAgency = namedtuple('GtfsAgency', 'agency_id agency_name agency_url agency_timezone agency_lang agency_email')
|
||||
GtfsRoute = namedtuple('GtfsRoute', 'agency_id route_id route_long_name route_type route_short_name')
|
||||
GtfsRoute = namedtuple('GtfsRoute', 'agency_id route_id route_long_name route_type route_short_name route_color route_text_color')
|
||||
GtfsStop = namedtuple('GtfsStop', 'stop_id stop_lat stop_lon stop_name')
|
||||
GtfsStopTime = namedtuple('GtfsStopTime', 'trip_id departure_time arrival_time stop_id stop_sequence pickup_type drop_off_type timepoint')
|
||||
GtfsTrip = namedtuple('GtfsTrip', 'route_id trip_id driver_id service_id shape_id trip_headsign bikes_allowed trip_url')
|
||||
|
|
|
|||
Loading…
Reference in a new issue