Implemented rules
November 18, 2020 ยท View on GitHub
Rules are declared in the Notice module. Below are details of currently implemented rules.
Table of Errors
| Error ID | Error Title |
|---|---|
| E001 | Missing required field |
| E003 | Missing required file |
| E004 | Invalid csv row length |
| E005 | Cannot parse integer |
| E006 | Cannot parse float |
| E007 | Cannot download archive |
| E008 | Cannot unzip archive |
| E010 | Integer field value out of range |
| E011 | Float field value out of range |
| E012 | Invalid url field value |
| E013 | Invalid timezone field value |
| E014 | Invalid color field value |
| E015 | Missing required value |
| E016 | Invalid time value |
| E017 | Cannot parse date |
| E018 | Invalid currency code |
| E019 | Illegal field value combination |
| E020 | Duplicated entity |
| E021 | Unexpected enum value |
| E022 | Invalid language code |
| E023 | Invalid email |
| E024 | Same name and description for route |
| E025 | Insufficient route color contrast |
| E026 | Invalid route type |
| E027 | Missing route short name and long name |
| E028 | Route long name equals short name |
| E029 | Missing field agency_id for file agency.txt with more than 1 record |
| E030 | Inconsistent field agency_timezone |
| E031 | Invalid agency_id |
| E032 | calendar.txt end_date is before start_date |
| E033 | route_id not found in GTFS routes.txt |
| E034 | shape_id not found in GTFS shapes.txt |
| E035 | agency_id not found in GTFS agency.txt |
| E036 | service_id not found in GTFS calendar.txt or calendar_dates.txt |
| E037 | trip_id not found in GTFS trips.txt |
| E038 | All shapes should be used in trips.txt |
| E039 | feed_start_date after feed_end_date |
| E040 | Dataset should be valid for at least the next 7 days |
| E041 | Invalid parent location_type for stop |
| E042 | Station stop (location_type=2) has a parent stop |
| E043 | Duplicated field |
| E044 | Missing trip edge arrival_time or departure_time |
| E045 | arrival_time after departure_time in stop_times.txt |
| E046 | Fast travel between stops in stop_times.txt |
| E047 | Csv file is empty |
| E048 | end_time after start_time in frequencies.txt |
| E049 | Backwards time travel between stops in stop_times.txt |
| E050 | Trips must be used in stop_times.txt |
| E051 | Trips must have more than one stop to be usable |
| E052 | Stop too far from trip shape |
| E053 | Trip frequencies overlap |
| E054 | Block trips must not have overlapping stop times |
| E055 | Mismatching feed and agency language fields |
| E056 | Missing calendar_dates.txt and calendar.txt files |
| E057 | Decreasing shape_dist_traveled in stop_times.txt |
| E058 | Decreasing shape_dist_traveled in shapes.txt |
| E059 | GTFS dataset too big |
| E060 | Fatal internal error -- please report |
| E061 | Out of memory |
Table of Warnings
| Warning ID | Warning Title |
|---|---|
| W001 | Input zip archive contains folder |
| W002 | Non standard field name |
| W003 | Non ascii or non printable char in id |
| W004 | Extra file found |
| W005 | Route short name too long |
| W006 | Missing route short name |
| W007 | Missing route long name |
| W008 | Route long name contains short name |
| W009 | Dataset should cover at least the next 30 days of service |
| W010 | feed_end_date should be provided if feed_start_date is provided |
| W011 | feed_start_date should be provided if feed_end_date is provided |
| W012 | Optional csv file is empty |
| W014 | Duplicate routes.route_long_name |
| W015 | Duplicate routes.route_short_name |
| W016 | Duplicate combination of fields route_long_name and routes.route_short_name |
Errors
E001 - Missing required field
A field marked as required is missing.
E003 - Missing required file
A file marked as required is missing.
E004 - Invalid csv row length
A csv file row length does not match header row length.
E005 - Cannot parse integer
Value of a field with type integer could not be parsed as such.
E006 - Cannot parse float
Value of a field with type float could not be parsed as such.
E007 - Cannot download archive
An error happened when trying to download gtfs archive from network.
E008 - Cannot unzip archive
An error happened when trying to unzip gtfs archive.
E010 - Integer field value out of range
Value of field with type integer is out of range.
E011 - Float field value out of range
Value of field with type float is out of range.
E012 - Invalid url field value
Value of field with type url is not valid.
References:
E013 - Invalid timezone field value
Value of field with type timezone is not valid.
References:
E014 - Invalid color field value
Value of field with type color is not valid.
References:
E015 - Missing required value
A value marked as required is missing.
E016 - Invalid color field value
Value of field with type time is not valid.
References:
E017 - Cannot parse date
Value of a field with type date could not be parsed as such.
References:
E018 - Invalid currency code
Value of field with type currency code is not valid.
References:
E019 - Invalid field combination
Definition of some fields is not valid under the GTFS specification```
E020 - Duplicated entity
Some gtfs entity defined multiple times in dataset.
E021 - Unexpected enum value
Value of field with type enum is unexpected.
E022 - Invalid language code
Language codes used in a GTFS feed should be under the IETF BCP 47 format. Please visit links below for an introduction to IETF BCP 47.
References:
E023 - Invalid email
An email should be a valid email address (e.g., contact@agency.org)
References:
E024 - Same name and description for route
The GTFS spec defines routes.txt route_description as:
Description of a route that provides useful, quality information. Do not simply duplicate the name of the route.
See the GTFS and GTFS Best Practices links below for more examples of how to populate the route_short_name, route_long_name, and route_description fields.
References:
GTFS routes.txt GTFS routes.txt Best Practices
References:
E025 - Insufficient route color contrast
A Route color and a Route text color should be contrasting. Minimum Contrast Ratio allowed is 4.5. Contrast Ratio is computed according to the W3 Color Contrast Procedure. Please visit links below for more information about color contrast.
References:
E026 - Invalid route type
E027 - Missing route short name and long name
At least one of routes.route_short_name or routes.route_long_name should be provided - both can't be blank or missing.
References:
E028 - Route long name equals short name
E029 - Missing agency_id for file agency.txt with more than 1 record
All records of file agency.txt should have a non-null value for field agency_id when this file counts more than one record.
E030 - Inconsistent field agency_timezone
All records of file agency.txt should have the same value for field agency_timezone agency_id when this file counts more than one record.
E031 - Invalid agency_id
When provided field agency_id should not be blank.
E032 - calendar.txt end_date is before start_date
In calendar.txt, the end_date of a service record must not be earlier than the start_date.
References:
E033 - route_id not found in GTFS routes.txt
Value of field route_id should exist in GTFS routes.txt.
E034 - shape_id not found in GTFS shapes.txt
Value of field shape_id should exist in GTFS shapes.txt.
E035 - agency_id not found in GTFS agency.txt
Value of field agency_id should exist in GTFS agency.txt.
E036 - service_id not found
Value of field service_id should exist in GTFS calendar.txt or calendar_dates.txt.
E037 - trip_id not found in GTFS trips.txt
Value of field trip_id should exist in GTFS trips.txt.
E038 - All shapes should be used in trips.txt
All records defined by GTFS shapes.txt should be used in trips.txt.
E039 - feed_start_date after feed_end_date
The feed_end_date date must not precede the feed_start_date date if both are given.
References:
E040 - Dataset should be valid for at least the next 7 days
At any time, the published GTFS dataset should be valid for at least the next 7 days, and ideally for as long as the operator is confident that the schedule will continue to be operated.
References:
E041 - Invalid parent location_type for stop
Value of field location_type of parent found in field parent_station is invalid.
According to spec
- Stop/platform can only have Station as parent
- Station can NOT have a parent
- Entrance/exit or generic node can only have Station as parent
- Boarding Area can only have Platform as parent
Any other combination raise this error.
References:
E042 - Station stop (location_type = 2) has a parent stop
Field parent_station must be empty when location_type is 2.
References:
E043 - Duplicated field
A file cannot contain the same header value twice (i.e., duplicated column of data).
E044 - Missing trip edge arrival_time and departure_time
First and last stop of a trip must define both fields.
E045 - arrival_time after departure_time in stop_times.txt
The departure_time must not precede the arrival_time in stop_times.txt if both are given.
References:
E046 - Fast travel between stops in stop_times.txt
Calculated speed between stops is too fast (>150 kmh).
E047 - Csv file is empty
Empty csv file found in the archive: file does not have any headers, or is a required file and does not have any data. The GTFS specification requires the first line of each file to contain field names and required files must have data. This is related to W012.
References:
E048 - end_time after start_time in frequencies.txt
The end_time must not precede the start_time in frequencies.txt.
References:
E049 - Backwards time travel between stops in stop_times.txt
For a given trip_id, the arrival_time of (n+1)-th stoptime in sequence must not precede the departure_time of n-th stoptime in sequence.
E050 - Trips must be used in stop_times.txt
Trips must be referred to at least once in stop_times.txt.
E051 - Trips must have more than one stop to be usable
A trip must visit more than one stop in stop_times.txt to be usable by passengers for boarding and alighting.
E052 - Stop too far from trip shape
Per GTFS Best Practices, route alignments (in shapes.txt) should be within 100 meters of stop locations which a trip serves.
References:
E053 - Trip frequencies overlap
Trip frequencies must not overlap in time
References:
E054 - Block trips must not have overlapping stop times
Trip stop times should not overlap when they are part of the same block operating on the same day.
References:
E055 - Mismatching feed and agency language fields
Files agency.txt and feed_info.txt must define matching agency.agency_lang and feed_info.feed_lang.
The default language may be multilingual for datasets with the original text in multiple languages. In such cases, the feed_lang field should contain the language code mul defined by the norm ISO 639-2.
- If
feed_langis notmuland does not match withagency_lang, that's an error - If there is more than one
agency_langandfeed_langisn'tmul, that's an error - If
feed_langismuland there isn't more than oneagency_lang, that's an error
References:
E056 - Missing both calendar_dates.txt and calendar.txt files
Both files calendar_dates.txt and calendar.txt are missing from the GTFS archive. At least one of the files must be provided.
E057 - Decreasing shape_dist_traveled in stop_times.txt
Stop times in a trip should have increasing distance.
E058 - Decreasing shape_dist_traveled in shapes.txt
shape_dist_traveled should increase along a shape.
E059 - GTFS dataset too big
Dataset could not be processed because of its size: maximum zip file is set to 65MB.
E060 - Fatal internal error -- please report
An exception occurred, and the validator could not complete the validation process. Please report this error.
E061 - Out of memory
An OutOfMemoryError has been raised either because dataset was too big, or because too many notices were generated.
References:
Warnings
W001 - Input zip archive contains folder
A gtfs zip archive cannot contain a folder.
W002 - Non standard field name
Field not defined in the specification found. It will be ignored.
W003 - Non ascii or non printable char in id
A value of filed with type id contains non ascii or non printable characters. This is not recommended.
W004 - Extra file found
File not defined in the specification found. It will be ignored.
W005 - Route short name too long
W006 - Missing route short name
W007 - Missing route long name
W008 - Route long name contains short name
W009 - Dataset should cover at least the next 30 days of service
If possible, the GTFS dataset should cover at least the next 30 days of service
References:
W010 - feed_end_date should be provided if feed_start_date is provided
feed_end_date should be provided in conjunction with field feed_start_date.
W011 - feed_start_date should be provided if feed_end_date is provided
feed_end_date should be provided in conjunction with field feed_start_date.
W012 - Optional csv file is empty
Empty csv optional file found in the archive: file contains header but does not have data.
This is related to E047.
W014 - Duplicate routes.route_long_name
All routes should have different routes.route_long_name. If routes have the same routes.route_long_name, they must be different routes serving different areas; and must not be different trips of the same route or different directions of the same route.
Note that two routes can have the same routes.route_long_name if they do not belong to the same agency.
W015 - Duplicate routes.route_short_name
All routes should have different rouytes.route_short_name. If routes have the same routes.route_short_name, they must be different routes serving different areas; and must not be different trips of the same route or different directions of the same route.
Note that two routes can have the same routes.route_short_name if they do not belong to the same agency.
W016 - Duplicate combination of fields routes.route_long_name and routes.route_short_name
The same combination of route_short_name and route_long_name should not be used for more than one route.