georust / gpx

Rust read/write support for GPS Exchange Format (GPX)
https://crates.io/crates/gpx
MIT License
102 stars 46 forks source link

Validate latitude and longitude #38

Closed sosna closed 4 years ago

sosna commented 4 years ago

The latitudeType and longitudeType defined by the GPX 1.1 specification expect latitude to be between [-90.0, 90.0] and longitude to be between [-180.0, 180.0[.

This PR adds checks to verify these expectations are met. Is it something useful for this library?

If so, is the check implemented in a reasonable way? I have Java background and I'm still learning Rust, so I fear the code might not be idiomatic yet :)...

Thank you.

oherrala commented 4 years ago

Thanks! Looks good to me.