![]() |
Decimal formatting in GPX 1.0 and 1.1 - Printable Version +- RouteConverter Forum (https://forum.routeconverter.com) +-- Forum: Users (https://forum.routeconverter.com/forum-17.html) +--- Forum: English: Discussions (https://forum.routeconverter.com/forum-12.html) +--- Thread: Decimal formatting in GPX 1.0 and 1.1 (/thread-2436.html) |
Decimal formatting in GPX 1.0 and 1.1 - mrihtar - 16.10.2017 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/RouteConverter/commits/master . RE: Decimal formatting in GPX 1.0 and 1.1 - routeconverter - 16.10.2017 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? RE: Decimal formatting in GPX 1.0 and 1.1 - mrihtar - 16.10.2017 > 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? RE: Decimal formatting in GPX 1.0 and 1.1 - routeconverter - 19.11.2017 Please double check the changes in this branch: https://github.com/cpesch/RouteConverter/tree/accuracy-fixes Are they ok for you? RE: Decimal formatting in GPX 1.0 and 1.1 - routeconverter - 02.12.2017 Since I've received no reply and need to go on with development, I've merge the https://github.com/cpesch/RouteConverter/tree/accuracy-fixes branch |