Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double's being written as exponents in GPX file #151

Closed
MCMaestro opened this issue Nov 13, 2021 · 3 comments
Closed

Double's being written as exponents in GPX file #151

MCMaestro opened this issue Nov 13, 2021 · 3 comments
Assignees
Labels
Milestone

Comments

@MCMaestro
Copy link

When a GPX file is created, because of Lat and Long values being stored as doubles, they are sometimes written as exponents
EG -3.1E-4 instead of -0.00031
Not sure if there's a simple solution to this?

@jenetics
Copy link
Owner

The data type of the latitude and longitude value is xsd:decimal.

<xsd:simpleType name="latitudeType">
    <xsd:restriction base="xsd:decimal">
    <xsd:minInclusive value="-90.0"/>
    <xsd:maxInclusive value="90.0"/>
    </xsd:restriction>
</xsd:simpleType>

The library uses the Double::toString method for converting a double value to a string, which might produce an exponential representation of the double value. So in this sense, this is a bug, which should be fixed.

Can you attach an example file with this error? And which application has problems reading these values?

@jenetics jenetics added the bug label Nov 13, 2021
@MCMaestro
Copy link
Author

MCMaestro commented Nov 13, 2021

test42.gpx.txt

GPX file attached (added .txt for GitHub to accept).

Only applications I've tried it with are Basecamp and Viewranger - both fail to parse the file, and don't import anything.
I've manually altered the gpx to correct the exponent to a number, and then they are happy and parse the file.

jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 14, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
jenetics added a commit that referenced this issue Nov 15, 2021
@jenetics
Copy link
Owner

Merged into r3.0.0 branch.

jenetics added a commit that referenced this issue Nov 16, 2021
jenetics added a commit that referenced this issue Nov 16, 2021
@jenetics jenetics added this to the v3.0.0 milestone Nov 16, 2021
@jenetics jenetics self-assigned this Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants