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

GpxLongitude handles +180 incorrectly #25

Closed
airbreather opened this issue Sep 8, 2018 · 1 comment
Closed

GpxLongitude handles +180 incorrectly #25

airbreather opened this issue Sep 8, 2018 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@airbreather
Copy link
Member

airbreather commented Sep 8, 2018

In the GPX schema, longitudeType's upper-bound is 180, exclusive.

GpxLongitude, however, allows values with +180.

This mismatch makes it possible, under normal circumstances, to produce values that are invalid for GPX.

Legal options:

  1. Keep allowing +180 in GpxLongitude, and convert it to -180 only when writing XML
  2. Reject +180 in the GpxLongitude constructor; convert +180 to -180 when converting from NTS
  3. Treat +180 and -180 as the same value
  4. Convert +180 to -180, silently, in the GpxLongitude constructor
@airbreather airbreather self-assigned this Sep 8, 2018
@airbreather airbreather added the bug Something isn't working label Sep 8, 2018
@airbreather airbreather added this to the 0.3.0 milestone Sep 8, 2018
@airbreather
Copy link
Member Author

airbreather commented Sep 8, 2018

Keep allowing +180 in GpxLongitude, and convert it to -180 only when writing XML

This feels like the way to go. Perhaps a GpxWriterSettings flag could be added that allows technically violating the schema and skipping this step.

Hmm, on second thought, not right now.

Reject +180 in the GpxLongitude constructor; convert +180 to -180 when converting from NTS

This is actually slightly better. If we start out by making something an error, then we can relax that error condition later without worrying about breaking working code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant