Skip to content

fast_travel_between_far_stops incorrectly calculates distance when Flex location is between two stops #2031

@westontrillium

Description

@westontrillium

Describe the bug

The validator seems to be calculating the distance between two fixed stops incorrectly when a location.geojson record is between those two stop times. The distance is several magnitudes larger than reality (e.g., ~17,000,000 meters vs an expected distance of ~2,000 meters). This is causing false positives for the fast_travel_between_far_stops warning.

Steps/Code to Reproduce

Run this dataset through the validator:
greenmtncn-vt-us--flex-v2-TEST.zip

Expected Results

The validation results should calculate the distance between two stops correctly even if there is a Flex zone between those two stops. In this case, it shouldn't throw a warning because the distance is not that far relative to the time.

Notice the distance between the two stops with arrival times of 14:48:00 and 14:56:00, respectively:

Image

Actual Results

Validation results: https://gtfs-validator-results.mobilitydata.org/98b0cbfc-f424-4c19-97a2-c69f39cfa8a1/report.html

Example:
stop_times.trip_id=t_5959537_b_83643_tn_1, stop_sequence=1 to stop_sequence=3

shape_dist_traveled in dataset: 2466.4772193312524m

The validation calculates the distance as 17295.69704407396km and throws a warning:

Image

Screenshots

No response

Files used

No response

Validator version

Production Web UI

Operating system

MacOS

Java version

No response

Additional notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working (crash, a rule has a problem)status: Needs triageApplied to all new issues

    Type

    No type

    Projects

    Status

    Requires investigation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions