geo icon indicating copy to clipboard operation
geo copied to clipboard

Generic implementation of geodesic_destination for Point

Open arpadav opened this issue 1 year ago • 2 comments

  • [x] I agree to follow the project's code of conduct.
  • [x] I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

Previously was only implemented for f64

Question: Not too happy about the unwrap's, any way to avoid? Or will the trait bounds of CoordFloat prevent to_f64 and from from ever being None?

arpadav avatar Jul 26 '24 14:07 arpadav

There isn't anything meaningfully generic happening here. I can see how automatically converting to and from the underlying data type where all the calculations happen is a convenient API, but it could be misleading, and I don't like the additional unwraps.

Or will the trait bounds of CoordFloat prevent to_f64 and from from ever being None?

I'm not sure about that. Care to investigate?

A different approach would be to convert your geometries in your application code to f64 when you want to use these f64 methods. The MapCoords trait might be helpful there.

michaelkirk avatar Jul 26 '24 15:07 michaelkirk

Ultimately agree with your sentiment. The last thing I want is to be misleading for the sake of convenience, and MapCoords looks promising despite the overhead

Can close, but can always revisit if geographiclib updates the WGS84 impl to use generics rather than f64. Or if someone re-writes the calculation without said dependency

arpadav avatar Jul 26 '24 16:07 arpadav

Closing this based on previous discussion.

michaelkirk avatar Sep 26 '24 18:09 michaelkirk