Skip to content
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

Check for existence of a shape_id for each trip #1277

Open
owades opened this issue Oct 17, 2022 · 2 comments
Open

Check for existence of a shape_id for each trip #1277

owades opened this issue Oct 17, 2022 · 2 comments
Labels
community rules This is used for Out of Spec / Out of Best Practice rules that we'd like to include in the validator new rule New rule to be added status: Blocked Can't work on it currently because of an external factor.

Comments

@owades
Copy link

owades commented Oct 17, 2022

Describe the problem

The California Minimum General Transit Feed Specification (GTFS) Guidelines require that schedule feeds, "Include shapes.txt, with valid route shapes for each trip."

While gtfs-validator performs some validation on the shapes in shapes.txt, it does not (to my knowledge) confirm that there exists a shape for each trip in trips.txt.

Describe the new validation rule

If there exists at least one row in trips.txt with a null value in the shape_id column, trigger a "missing_shape_id" notice.

Sample GTFS datasets

No response

Severity

Warning

Additional context

Note that, once a shape_id is referenced in trips.txt, the foreign_key_violation rule will check whether that shape_id actually appears in shapes.txt

@owades owades added new rule New rule to be added status: Needs triage Applied to all new issues labels Oct 17, 2022
@isabelle-dr
Copy link
Contributor

Hello @owades,

If I understand correctly, a valid dataset according to this Cal-ITP's Guidelines would mean

  • shapes.txt is required
  • every row of trips.txt would need to have shape_id associated

As mentioned in the other issues, we plan to change the validator architecture to allow users to do such changes. What it would look like on your end could be either:

  • Making shapes.txt Required instead of Optional and trips.shape_id Required instead of Optional in Cal-ITP's validation set. This way, you'd have the existing missing_required_file and missing_required_field notices triggered.
  • Adding two new rules that would only apply to Cal-ITP's validation set, which would trigger new notices: missing_shape_file, and missing_shape_id.

It would be great to have your comments in Google's proposal here.

@isabelle-dr isabelle-dr added status: Needs discussion We need a discussion on requirements before calling this issue ready community rules This is used for Out of Spec / Out of Best Practice rules that we'd like to include in the validator and removed status: Needs triage Applied to all new issues labels Nov 3, 2022
@isabelle-dr isabelle-dr added status: Blocked Can't work on it currently because of an external factor. and removed status: Needs discussion We need a discussion on requirements before calling this issue ready labels Nov 3, 2022
@isabelle-dr
Copy link
Contributor

Labeling as blocked, let's come back to this issue when we close issue #1067.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community rules This is used for Out of Spec / Out of Best Practice rules that we'd like to include in the validator new rule New rule to be added status: Blocked Can't work on it currently because of an external factor.
Projects
None yet
Development

No branches or pull requests

2 participants