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

Shape Test Fail #33

Open
PatrickSteil opened this issue Oct 18, 2024 · 2 comments
Open

Shape Test Fail #33

PatrickSteil opened this issue Oct 18, 2024 · 2 comments

Comments

@PatrickSteil
Copy link
Contributor

Hey @patrickbr

When I built the project and ran the tests, the TestShapeMinimizer failed.

~/Documents/gtfstidy$ make test
ok github.com/patrickbr/gtfstidy 0.135s coverage: 0.0% of statements
Minimizing frequencies / stop times... done. (+0 frequencies [+0.00%], +0 trips [+0.00%])
Removing redundant routes... done. (-7 routes [-43.75%])
Removing service duplicates... done. (-2 services [-39.99%])
Remeasuring shapes... done. (3 shapes remeasured)
Removing redundant shapes... done. (-1 shapes [-33.32%])
Remeasuring shapes... done. (3 shapes remeasured)
Minimizing shapes... done. (-6 shape points [-33.33%])
--- FAIL: TestShapeMinimizer (0.00s)
    shapeminimizer_test.go:51: {3.5 1 3 42.902325}
    shapeminimizer_test.go:67: {3.5 1 3 42.902325}
Removing redundant stops... done. (-3 stops [-10.00%])
FAIL
coverage: 33.1% of statements
FAIL github.com/patrickbr/gtfstidy/processors 0.040s
FAIL
make: *** [Makefile:32: test] Error 1

I don't know if it's a rounding error because both differ from the test case only in the Dist_travelled:
42.902325 vs 42.910156 (expected value) and 42.902325 vs 42.910156 (expected value).

Kind regards,
Patrick

@PatrickSteil
Copy link
Contributor Author

PatrickSteil commented Oct 19, 2024

The commit 7c5f215 introduced the Haversine Formula, and replaced the Web Mercator projection. This explains the slightly different distances.

@PatrickSteil
Copy link
Contributor Author

Fixed in #34 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant