MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
266 stars 100 forks source link

feat: New rule - SingleShapePointValidator for flagging shapes with a single shape point #1753

Closed praneethd7 closed 4 weeks ago

praneethd7 commented 1 month ago

Summary:

Reference - #1733. Some GTFS feeds have shapes with a single shape point. These route shapes cannot be visualized on any GIS software (which requires LineString) and are therefore indicative of an error in the creation (as a line requires a minimum of two points)

Expected behavior:

The new rule flags such cases with the single_shape_point notice which reports the shape_id and csvRowNumber of the shape with a single shape point(one row in the feed).

Example Feed - LANTA GTFS: image

Please make sure these boxes are checked before submitting your pull request - thanks!

welcome[bot] commented 1 month ago

Thanks for opening this pull request! You're awesome. We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of titles with semantic prefixes:

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

qcdyx commented 1 month ago

Hello @praneethd7, thank you for contributing to the GTFS Validator. I have two pieces of feedback:

  1. The Java Formatting check is failing. Could you fix it by running ./gradlew goJF or gradle goJF?
  2. The Rule acceptance test/compare-outputs check is failing. There are 22 new warnings out of 1520 datasets (~1%) that are invalid due to code change, which exceeds the 1% threshold. Could you review these 22 datasets to see if they actually have the single shape point issue?
praneethd7 commented 1 month ago

Hi @qcdyx! Thank you for your suggestions. I have re-formatted the code according to the Google Java format. Is there a way to know which are those 22 feeds that have this error? Also, I am not sure if I have access to all of them. Please let me know.😄

qcdyx commented 1 month ago

Hello @praneethd7 Yes, you have access to those 22 feeds. To get them, goto https://github.com/MobilityData/gtfs-validator/actions/runs/9197621511?pr=1753, scroll down to bottom, find the [acceptance_test_report] artifact(https://github.com/MobilityData/gtfs-validator/actions/runs/9197621511/artifacts/1541824946), and download it. image Unzip acceptance_test_report.zip, open acceptance_test_report.json and search for "sourceUrl", you can click the link and download the dataset. Don't forget to format code again since we merge master branch into your branch.

praneethd7 commented 1 month ago

@qcdyx Thank you for helping me with the code formatting. I have manually checked the 22 feeds and they all have single_shape_point error. I have verified the notice counts for each feed and everything seems to be reported correctly. I guess we are good to go :)

qcdyx commented 1 month ago

@emmambd Should we consult with the spec team to verify the naming and description of the single_shape_point notice?

emmambd commented 1 month ago

@qcdyx No, that one's for me to review! @praneethd7 The name looks great! I made a minor comment on the description for the sake of being generic.

praneethd7 commented 4 weeks ago

@emmambd @qcdyx Thank you for the suggestions. Changed the rule description

qcdyx commented 4 weeks ago

@praneethd7 Great, you PR is merged. Thanks again for contributing to GTFS Validator.

welcome[bot] commented 4 weeks ago

:partying_face: Congrats on getting your first pull request merged!