akireserrano86 / googletransitdatafeed

Automatically exported from code.google.com/p/googletransitdatafeed
0 stars 0 forks source link

FeedValidator should warn about extremely large transfers #234

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When a feed has an extremely large transfer (be it in terms of time or 
stop/station distance) it most likely represents a data error. 

Even though the spec does not forbid it, in practice it makes little sense 
to specify a transfer between stops/stations that many kilometers apart, or 
a min_transfer_time of several hours or days.

As such a warning should be added for values that are large but still 
somewhat plausible, and an error for even larger values. We should also 
check min_transfer_time with relation to the station/stop distance.

Original issue reported on code.google.com by a...@google.com on 23 Apr 2010 at 12:00

GoogleCodeExporter commented 8 years ago
This validation has to be added to Tranfer.ValidateAfterAdd, since we need the 
schedule to be able to access the stops.

However, since invalid transfers (no or invalid {to,from}_stop_id and 
min_transfer_time) are also added to the schedule 
we'd have to rerun the very same checks that are in ValidateBeforeAdd to guard 
against that.

IMHO the cleanest way of doing this would be to *not* add invalid transfers to 
the schedule, so ValidateAfterAdd is only 
run on Transfers that seem to be correct. Also add a validation to see if 
{to,from}_stop_id reference valid stop_ids 
before cheking if the transfer is too large.

I'm CCing Tom for his input on this - do you think this is a good idea, or is 
there something I'm missing that prevents 
us from doing this? And, of course, if there's anyone using the transitfeed 
package and relying on the current behavior 
please update this bug to let me know.

Original comment by a...@google.com on 23 Apr 2010 at 12:48

GoogleCodeExporter commented 8 years ago
Fix committed in revision 1307.

Original comment by a...@google.com on 14 May 2010 at 4:39