Programming · free software · the open webSubscribe via RSS

What Makes a GTFS Feed a Complete Dataset?

From the earlier reference collection. Read the current software blog.

Feed completeness depends on the specification’s file and field requirements, including requirements that apply only under stated conditions.

Completeness is defined by the reference

A feed is not complete merely because it opens as a ZIP archive or contains several familiar CSV files. GTFS defines a dataset as a set of files and describes which files and fields are required, optional, or conditionally required. Those conditions matter: a file may be unnecessary in one dataset and required in another when a specified feature or circumstance applies. The current GTFS reference is the appropriate checklist because requirements can be revised.

Check structure before interpreting values

Begin by listing the files and checking their headers against the relevant reference entries. A required file needs the required fields; required values must be present and valid for each applicable record. Optional fields and files may be absent where the specification permits. A header alone does not prove completeness: a required column can exist while its cells are blank, malformed, or inconsistent with references elsewhere in the dataset.

For a simple example, a consumer can first verify that routes.txt and trips.txt exist with their required columns, then check that trip records point to routes present in routes.txt. The first check concerns file shape; the second concerns relationships between records. Both are necessary for useful data, but they answer different questions.

Apply conditional requirements carefully

Some requirements depend on what the feed describes. A validator should read the condition attached to a file or field rather than treating every listed item as universally mandatory. Conversely, a publisher should not omit a conditionally required item just because a minimal sample feed worked without it. Review the feature being represented, then follow the corresponding requirement and any constraints on its values.

The reference also distinguishes a field being present from a field having a value: a column can exist even when some or all of its cells are empty. That distinction prevents a superficial header check from being mistaken for semantic validation.

Make a release checklist reproducible

A useful publishing check records the specification revision used, enumerates required files, validates required fields and values, evaluates conditional requirements, and checks cross-file identifiers. Keep warnings separate from failures so maintainers can investigate issues without silently weakening actual requirements. The GTFS reference’s presence terminology provides the basis for these checks. A repeatable checklist lets a team explain why a dataset qualifies as complete and rerun the same review after edits or before the next release.

References

  1. GTFS Schedule Reference

Suggest a correction · All posts