ranges for a single service_id. These date ranges should not overlap;
in the case of overlap between two date ranges, a parser should
discard the one which occurs later in the calendar.txt file. If the
same service_id is used in both calendar.txt and calendar_dates.txt,
the individual date additions and removals in calendar_dates.txt would
be applied to the date ranges as they are currently.
My goal here is that the expected behavior of parsers is as
well-defined as possible, especially in edge cases. (In practice, we
should expect that people want to write parsers that give useful
output for as much input as possible.)
I'll count your message as a vote for an alternate interpretation of
this edge case: that overlapping ranges should be allowed, and that
the resulting service period has the union of the active days defined
by all the ranges with that service_id. (Any additions and removals
of dates in calendar_dates.txt are then performed on that union.)
Joe
| "Joe Hughes"
<joe.hug...@gmail.com>
Sent by: gtfs-c...@googlegroups.com 03/11/2008 03:02 PM
|
|
Joe
On Wed, Mar 12, 2008 at 5:11 AM, mikeness <mike...@dsl.pipex.com> wrote:
> Another way of achieving the same effect of compressing file size (and
> complexity of generating the file) would be to add a new field (end
> date of range) to calendar_dates.txt which would allow it to hold a
> range of exceptional dates, rather than the single exceptional date as
> now. The range could still be additional dates or no-service dates as
> now and would default to a single date if only one date was specified.
That's an interesting proposal. The main disadvantage of doing the
multiple ranges in calendar_dates.txt instead of calendar.txt is that
you lose the ability to specify days of the week, so if you're trying
to specify multiple ranges during the year that have a particular type
of weekend service, you'd need to do a saturday-sunday range for each
individual weekend, instead of having ranges a couple months long that
have the saturday & sunday flags set.
> As a point of interest should dates in calendar_dates.txt be within
> the range defined in calendar.txt or can calendar_dates.txt be used to
> extend the range of service validity. Equally does an additional date
> in calendar_dates.txt which is not one one the defined days (Monday to
> Sunday) overide the defined days. Are dates and days considered as
> 'and' conditions or as 'or' conditions. The specification does not
> make this clear at the moment.
You're right--we've iterated that wording in past revisions in an
attempt to improve this, but it's still not clear enough.
calendar_dates.txt modifies whatever range has been set in
calendar.txt, both in terms of adding service dates outside that range
and in removing dates from the range. It can also be used to
enumerate dates for a service_id on its own, without any corresponding
range defined in calendar.txt.
Joe