... the user friendly GPS tool


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Decimal formatting in GPX 1.0 and 1.1
#1
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 .
Reply
#2
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
Reply
#3
> 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?
Reply
#4
Please double check the changes in this branch: https://github.com/cpesch/RouteConverter...racy-fixes

Are they ok for you?
--
Christian
Reply
#5
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)