We are currently in the midst of integrating with a Norwegian company at work.
They supply the Norwegian bus- and trainstops with coordinates.
We want to show this to our customers at MatchOffice.no so that they can see how far a location is to public transportation.
This third party company supplies the coordinates in the UTM coordinate system.
We want to work with WGS84, because that is how most of our system works.
In order to do this, we want to convert the coordinate.
I initially thought: “Okay, so that’s probably something along the lines of lat * zone + lng”.
There’s a lot of complicated math involved.
I copied most of @mortonfox’s code from the YouTime repo.
Below is the code to do this, if anybody is interested.
Note: I strugged with this code for a long time (~2 hours), thinking I had misplaced a parenthesis.
I had not, but instead I had the following code:
Why would I switch the arguments - and more importantly: WHY DIDN’T I SEE THIS?
Also: to Elixir.
I love being able to test my code in the documentation!