tkrajina/gpxpy

Allow user to enforce Haversine distance

WPettersson opened this issue · 0 comments

I've noticed some of my distance measurements have been not quite right, and after some investigation I've realised that it's down to gpxpy using the simpler distance calculations that ignore the curvature of the Earth. I realise that this is on purpose, to avoid taxing calculations (see issue #9), but I'd like to at least be able to configure when it is used. For my use-case, computational load is not a concern, so I'd actually prefer to always use the haversine distance.

I'm happy to try to code this up myself, but was wondering how you think it best to include something like this. One option I thought might work would be to add a haversine option to the parse function, but it could also be a module-wide setting like gpxpy.haversineMinDistance = 0 to disable the cheaper computation and always use the haversine distance formula.