-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a list of validators that meet the official GTFS requirements #1315
Conversation
ec85aba
to
a35c231
Compare
* BlockTripsWithConsistentTypeValidator * FareAttributeAgencyIdValidator * FeedHasLanguageValidator * StationUsageValidator * StopNameLatLngRequiredValidator * StopTimeInSequenceOrderValidator * TransferFrequencyBasedTripValidator * TripShapeDistTraveledValidator
a35c231
to
f85c737
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM.
Hi @isabelle-dr, could you please take a look at the proposed validations if they look good? Do you know if there are any open issues that could be closed by this change?
...ain/java/org/mobilitydata/gtfsvalidator/validator/BlockTripsWithConsistentTypeValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/FeedHasLanguageValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StationUsageValidator.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/mobilitydata/gtfsvalidator/validator/StopNameLatLngRequiredValidator.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/mobilitydata/gtfsvalidator/validator/StopTimeInSequenceOrderValidator.java
Outdated
Show resolved
Hide resolved
.../main/java/org/mobilitydata/gtfsvalidator/validator/TransferFrequencyBasedTripValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/TripShapeDistTraveledValidator.java
Outdated
Show resolved
Hide resolved
It partially overlaps with StopTimeIncreasingDistanceValidator, so we will move it to a separate pull request.
Thanks for the ping @asvechnikov2! (and.. wow @aababilov 🎉). |
The LGTM. However, you do need to update |
I'd also call out that issue #1304 is probably still blocking us from getting a clean acceptance test run. |
public void validate(NoticeContainer noticeContainer) { | ||
if (agencyTable.entityCount() <= 1) { | ||
// fare_attributes.agency_id is not required when there is a single agency. | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isabelle-dr @aababilov I've added similar logic as part of #1318 and added a best practice MissingRecommendedFieldNotice
warning to recommend that agency_id
be included even when there is only one agency.
Hello! Sorry it took a while. A few things here:
|
I suggest we split this PR between what's explicitly mentioned in spec VS what is not. |
BlockTripsWithConsistentTypeValidator
BlockTripsWithInconsistentRouteTypesNotice
.FareAttributeAgencyIdValidator
fare_attributes.agency_id
field is defined for every row if there is more than 1 agency in the feed.MissingRequiredFieldNotice
.FeedHasLanguageValidator
feed_info.feed_lang
oragency.agency_lang
. Note thatfeed_lang
is a required field: if there is afeed_info
entity, it must havefeed_lang
set.agency_lang
, instead, is optional. The recommended way is to providefeed_lang
and omitagency_lang
.FeedHasNoLanguageNotice
.StationUsageValidator
location_type=1
) instops.txt
has child platforms (location_type=0
). Note that a station that has child entrances (location_type=2
) or generic nodes (location_type=3
) is also reported.StationWithoutPlatformsNotice
.StopLatLngRequiredValidator
stop_lat
andstop_lon
are set depending onlocation_type
.stop_lat
andstop_lon
are required for stations (location_type=0
), stops (location_type=1
) and entrances (location_type=2
) and optional for other types.MissingRequiredFieldError
.StopTimeInSequenceOrderValidator
arrival_time
,departure_time
andshape_dist_traveled
are non-decreasing along each trip.TripWithOutOfOrderArrivalTimeNotice
TripWithOutOfOrderDepartureTimeNotice
TripWithOutOfOrderShapeDistTraveledNotice
TransferFrequencyBasedTripValidator
TransferForFrequencyBasedTripNotice
.TripShapeDistTraveledValidator
stop_times.shape_dist_traveled
values properly. Please see generated notices for details.TripWithShapeDistTraveledButNoShapeNotice
TripWithShapeDistTraveledButNoShapeDistancesNotice
TripWithPartialShapeDistTraveledNotice