OpenLR
                                
                                 OpenLR copied to clipboard
                                
                                    OpenLR copied to clipboard
                            
                            
                            
                        Incorrect LineLocation encoding
Hi!
Step 9 in the LineLocation encoding is a little broken. It only works for 2 points. If you have more than 2 points it will only adjust the first 2 points and then move on to step 10 without checking the trailing point pairs if they are more than 15000 meters.
This library is very important in several projects so thanks for your feedback.
I looked at the code myself and I see what you mean. Did you discover this by reading the code? :+1:
It's on my list to fix but doesn't have a very high priority at the moment to be honest, this case is pretty rare. Did you run into this with a real-world case?
No problems mate!
I did not discover it by reading the code.
I discovered it when using the library and trying to encode very long routes.
Ah interesting!
If you can give me a simple test to reproduce the incorrect behaviour that would probably lead to a quick fix. Otherwise, it could be a while for me to get to fix this (because so busy with other stuff sorry).
A pull request is also welcome, if there are proper tests for the changed behaviour. I've noticed with this library the tests are absolutely crucial.