Posts: 6
Threads: 2
Joined: Jul 2013
Hi Christian,
I've noticed some missing formatting of decimals in GPX 1.0 and 1.1, so I've put together a fix in my Github clone. Maybe it's not the best solution, but serves the purpose. You might take a look at the last two commits in
https://github.com/mrihtar/RouteConverte...its/master .
Posts: 7,465
Threads: 223
Joined: Aug 2007
Dear mrihtar,
I've been trying to understand the commits.
Did the case that a double isNaN() really occur with your files?
Why didn't you introduce a method to check double for null and isNaN()?
Why did you increase the accuracy of elevation to centimeters when it's decimals at best?
--
Christian
Posts: 6
Threads: 2
Joined: Jul 2013
> Did the case that a double isNaN() really occur with your files?
> Why didn't you introduce a method to check double for null and isNaN()?
For GPX 1.1 I introduced two new formatting functions formatSpeedAsDouble() and formatTemperatureAsDouble(), which call formatDouble, which returns NaN in case of null. Because of that I had to fix isEmpty(), reorganize setting the value (maybe not necessary) and added some additional checks for isNaN (again maybe not necessary).
> Why did you increase the accuracy of elevation to centimeters when it's decimals at best?
I just set the same accuracy as it was already set in formatElevationAsString() (= 2). Maybe both should be at 1 then?
Posts: 7,465
Threads: 223
Joined: Aug 2007
Please double check the changes in this branch:
https://github.com/cpesch/RouteConverter...racy-fixes
Are they ok for you?
--
Christian
Posts: 7,465
Threads: 223
Joined: Aug 2007
Since I've received no reply and need to go on with development, I've merge the
https://github.com/cpesch/RouteConverter...racy-fixes branch
--
Christian