gtfstidy
gtfstidy copied to clipboard
Shape Test Fail
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
The commit https://github.com/patrickbr/gtfstidy/commit/7c5f215bb0d17794e4ae4db9a07e222e31e7591c introduced the Haversine Formula, and replaced the Web Mercator projection. This explains the slightly different distances.
Fixed in #34 .
Should be fixed with merge of #34