[TransXChange] OperatingPeriod and SpecialDaysOperation for Night Buses

Hi! I am struggling to understand how OperatingPeriod and SpecialDaysofOperation work for Night buses, and as a result how two files representing the schedule of one Night bus route connect.

Example: route N89 in TxC from 12/06

There are two files to represent the N89 schedules.

File 1 - ending in 76 - states that operating period is 10/06 - 23/06, and contains the schedules for that period. There are no SpecialDaysOperation around 23/06 or 24/06 in that file.

File 2 - ending in 77 - states that operating period is 24/06 to Dec 2023. It contains the schedules for that period. However, it has lots of SpecialDaysOperation around 24/06 that I don’t understand .

  • Lots of DaysOfNonOperation for 24/06 for Saturday
  • One DaysOfOperation for 24/06 for Sunday

However, Saturday is 23/06.

I am struggling to understand how the two files connect around 23-24/06. Could someone clarify? Thank you :pray:

Extracts of the files below :point_down:

OperatingPeriod in File 1 (ending in 76):

<Services>
   <Service>
      <ServiceCode>45-N89-_-y05-60476</ServiceCode>
      <PrivateCode>45-N89-_-y05-60476</PrivateCode>
      <Lines>
         <Line id="45-N89-_-y05-60476">
            <LineName>N89</LineName>
         </Line>
      </Lines>
      <OperatingPeriod>
         <StartDate>2023-06-10</StartDate>
         <EndDate>2023-06-23</EndDate>
      </OperatingPeriod>

OperatingPeriod in File 2 (ending in 77):

<OperatingPeriod>
				<StartDate>2023-06-24</StartDate>
				<EndDate>2023-12-23</EndDate>
			</OperatingPeriod>
			<OperatingProfile>
				<RegularDayType>
					<DaysOfWeek>
						<MondayToSunday />
					</DaysOfWeek>
				</RegularDayType>
				<BankHolidayOperation>
					<DaysOfOperation>
						<LateSummerBankHolidayNotScotland />
					</DaysOfOperation>
					<DaysOfNonOperation />
				</BankHolidayOperation>
			</OperatingProfile>

In File 2 (ending in 77): lots of SpecialDaysOperation > DaysOfNonOperation for Sat 24/06

<OperatingProfile>
   <RegularDayType>
      <DaysOfWeek>
         <Saturday />
      </DaysOfWeek>
   </RegularDayType>
   <SpecialDaysOperation>
      <DaysOfNonOperation>
         <DateRange>
            <StartDate>2023-06-24</StartDate>
            <EndDate>2023-06-24</EndDate>
         </DateRange>
      </DaysOfNonOperation>
   </SpecialDaysOperation>

In File 2 (ending in 77): only ONE SpecialDaysOperation > DaysOfOperation for Sun 24/06

<OperatingProfile>
				<RegularDayType>
					<DaysOfWeek>
						<Sunday />
					</DaysOfWeek>
				</RegularDayType>
				<SpecialDaysOperation>
					<DaysOfOperation>
						<DateRange>
							<StartDate>2023-06-24</StartDate>
							<EndDate>2023-06-24</EndDate>
						</DateRange>
					</DaysOfOperation>

Hmm

I’ve come across this kind of thing when I decoded the dates of operation and I’ve found the following patterns in the data,

The problem for overnight services (that start before midnight and finish afterwards) is which day(s) to attach the schedule to.

With the trains (and also broadcast TV) the tradition has been to make the service date run from 4am to 03:59am the following day.

Rather annoyingly TfL don’t use the 00:00 for midnight always.

The main problem with Night Buses/Tubes (rather than 24/7/365 services) is the 4am thing isn’t helpful as the “night” buses often run past 4am.

Anyway, the thing I got to work was using the Iso8601 day of the week AND the bitmap returned from the above function.

image
The data appears to use a 00:00 to 23:59:59 day allocation (for the start time if there’s an ofset then this can roll over into the next day: use Unix dates…)

1 Like

Thank you @briantist! This is helpful, I do have to look a bit more into this to fully get my head around this. I will let you know if I have any further questions :slight_smile:

Hi @ndjik. I’m not a TransXChange (TXC) expert by any means, so although I will try to assist as best I can, I cannot guarantee complete accuracy.

SpecialDaysOperation is described in Section 3.18.3 ‘Exceptional Operation – OperatingProfile’ on Pages 128-130 of the schema guide.

So to look at some of the specific examples you provided:

I interpret this as meaning that this VehicleJourney operates on Saturdays, except on 24th June (midnight to midnight).

I interpret this as meaning this VehicleJourney operates on Sundays, but also operates on 24th June, even though it is a Saturday.

1 Like

Thank you @LeonByford for the explanation, with a good example to illustrate! This makes more sense now.

@LeonByford, would this mean that on Sat 24/06, we apply a Sunday schedule?

I don’t think it’s quite the same as applying a Sunday schedule. Rather, some of the journeys that usually take place on a Saturday don’t take place, and one of the journeys from the Sunday schedule takes place on the Saturday. Therefore the actual schedule for that date is unique.

Section 3.18.5 “General Principles for Using Operational Days” on Page 133 of the schema guide provides quite a useful explanation of how operational days can be overridden.

@LeonByford, okay thanks! this kind of makes sense (?), but wouldn’t that mean that there is only one trip on that Saturday?

Wouldn’t it depend if you’re talking about Friday night / Saturday Morning or Saturday Night / Sunday Morning?

Judging by these:
http://www.londonbusroutes.net/times/N089.htm#4_C
http://www.londonbusroutes.net/times/N089.htm#4_T

There is just one trip before midnight on the Saturday night / Sunday morning service?

Simon