-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat: Implement ShapeToStopMatchingValidator #956
feat: Implement ShapeToStopMatchingValidator #956
Conversation
ed92803
to
535a527
Compare
This depends on #957 |
This also depends on #958 |
535a527
to
895ab75
Compare
Closing and reopening to apply the workflow defined in #953 that aims at checking code formatting. |
Thanks @aababilov, I am currently reviewing the PR - could you fix the merge conflict please? |
It validates that stops match to shapes properly, mostly focusing on making sure that the stop sequences for trips that reference the shape can be properly matched to the shape. ShapeToStopMatchingValidator replaces StopTooFarFromTripShapeValidator. Dependency on spatial4j is removed. Now GTFS Validator upstream can be compiled at Google.
895ab75
to
b11930f
Compare
All fixed and ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not finish the review yet, but here are a few first comments.
core/src/main/java/org/mobilitydata/gtfsvalidator/util/MathUtil.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/ShapeToStopMatchingValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/ShapeToStopMatchingValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/ShapeToStopMatchingValidator.java
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/ShapeToStopMatchingValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/ShapeToStopMatchingValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/ShapeToStopMatchingValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/validator/ShapeToStopMatchingValidator.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/util/shape/StopToShapeMatcherSettings.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/util/shape/Assignment.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another set of comments
main/src/main/java/org/mobilitydata/gtfsvalidator/util/shape/Problem.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/util/shape/Problem.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/util/shape/Problem.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/util/shape/ShapePoints.java
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/util/shape/ShapePoints.java
Show resolved
Hide resolved
StopUtil.getStopOrParentLatLng(stopTable, stopTime.stopId()).toPoint(), | ||
stopTime.shapeDistTraveled(), | ||
stopTime, | ||
stationSize.equals(StationSize.LARGE) && firstOrLastStop)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why considering firstOrLastStop
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agency shapes often do not extend till the very end of the track, especially for train stations. Although this is a data issue that agencies should fix, we would like to be more tolerant and not drop such shapes completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification!
main/src/test/java/org/mobilitydata/gtfsvalidator/util/shape/ShapePointsTest.java
Outdated
Show resolved
Hide resolved
Thanks for review! PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aababilov for working on that. LGTM.
@aababilov great work! Thank you for this contribution! Sorry to be late at the party but could you please update RULES.md with those new rules? |
It validates that stops match to shapes properly, mostly focusing on
making sure that the stop sequences for trips that reference the
shape can be properly matched to the shape.
ShapeToStopMatchingValidator replaces StopTooFarFromTripShapeValidator.
Dependency on spatial4j is removed. Now GTFS Validator consistently
uses the light-weight S2 Geometry library.