gtfs-validator icon indicating copy to clipboard operation
gtfs-validator copied to clipboard

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

Open praneethd7 opened this issue 9 months ago • 2 comments

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!

  • [x] Run the unit tests with gradle test to make sure you didn't break anything
  • [x] Add or update any needed documentation to the repo
  • [x] Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • [x] Linked all relevant issues
  • [x] Include screenshot(s) showing how this pull request works and fixes the issue(s)

praneethd7 avatar May 09 '24 16:05 praneethd7

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:

  • fix: Bug with ssl network connections + Java module permissions.
  • feat: Initial support for multiple @PrimaryKey annotations.
  • docs: update RELEASE.md with new process To get this PR to the finish line, please do the following:
  • Read our Contribution Guidelines
  • Follow Google Java style coding standards
  • Include tests when adding/changing behavior
  • Include screenshots

welcome[bot] avatar May 09 '24 16:05 welcome[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 09 '24 16:05 CLAassistant

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?

qcdyx avatar May 22 '24 15:05 qcdyx

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.😄

praneethd7 avatar May 22 '24 16:05 praneethd7

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.

qcdyx avatar May 27 '24 18:05 qcdyx

@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 :)

praneethd7 avatar Jun 04 '24 17:06 praneethd7

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

qcdyx avatar Jun 04 '24 23:06 qcdyx

@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.

emmambd avatar Jun 05 '24 11:06 emmambd

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

praneethd7 avatar Jun 05 '24 14:06 praneethd7

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

qcdyx avatar Jun 06 '24 14:06 qcdyx

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

welcome[bot] avatar Jun 06 '24 14:06 welcome[bot]