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

Support and tests for GPX waypoint accuracy information/values. #2

Closed
wants to merge 2 commits into from

Conversation

caspervg
Copy link
Contributor

@caspervg caspervg commented Jan 8, 2018

No description provided.

@frewsxcv
Copy link
Member

thanks for the pr! will wait to see if @brendanashworth has some thoughts about this change, otherwise i can take a look sometime

Copy link
Member

@brendanashworth brendanashworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, this looks really nice! Just a question about using an enum.

src/types.rs Outdated
/// is unknown", leave out `fix` entirely. Value comes from the list
/// `{'none'|'2d'|'3d'|'dgps'|'pps'}`, where `pps` means that the military
/// signal was used.
pub fix: Option<String>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using an enum here? This way users wouldn't need to validate results because we'd already have validated them.

We could probably add a fix.rs and use it like fix::consume(reader) or something, thoughts?

@caspervg
Copy link
Contributor Author

caspervg commented Jan 15, 2018

@brendanashworth Thanks for the enum suggestion. I've updated it as you suggested. I wasn't sure how to handle values that are not within the spec. For now they are wrapped inside a Fix::Other(string_value) enum value, but perhaps it should instead return an error.

I would personally prefer the current solution from a practical point of view (I'm unfortunately dealing with data that has unsupported values in the <fix> tags), but I'm fine with either way.

brendanashworth pushed a commit to brendanashworth/rust-gpx that referenced this pull request Jan 16, 2018
@brendanashworth
Copy link
Member

@caspervg that looks really nice, I appreciate the work you did on this. If we're dealing with data that isn't spec-compliant that seems like a logical way to handle it, good call.

I've merged this as 13ca700 after some nit fies, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants