Skip to content

Stop times > 23:59:59 unsearchable after midnight #23

Description

@elliottwilliams

For example, this stop time:
75R10,24:02:00,24:02:00,PLZA,3,Warm Springs/South Fremont,,,,1

...cannot be found by this visits_between query:
timetable.visits_between("PLZA", "20170728 00:00:00", "20170728 00:30:00", 5)

This is because we start searching at day of the requested time.

Activity

  1. faultyserver commented on Jul 28, 2017

    @faultyserver
    Member

    Nice catch. Just looking quickly, I think this could be resolved by simple changing the *_time members of gtfs::stop_time into resolved DateTimes.

    The comparisons in the query functions are converting them into DateTimes anyway, so I don't see much of a performance hit. In fact, this could actually be a massive storage improvement (12 bytes per DateTime vs 17 bytes per string representation; 400k stop times would mean megabytes of RAM being saved, plus the indices could be optimized).

  2. elliottwilliams commented on Jul 28, 2017

    @elliottwilliams
    MemberAuthor

    The issue is that stop times don't actually have associated dates, they're based on the calendar date a trip is active.

  3. faultyserver commented on Jul 28, 2017

    @faultyserver
    Member

    Right. Clearly I've been away from this for too long.

    A naive solution (sans maybe trans-atlantic aquatic transit support) could be to start the date iteration 2-3 days before the given start date.

    A less naive solution might iterate the stop times within the bounds of the query on the index and determine how far back the date needs to go.

    I can't think of a better way that wouldn't at least double memory or run time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions