uber / uber/h3

Question: haversine distance algorithm

Open
#411 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
6.5k
Forks
627
Avg merge
3d 21h
Merged PRs (30d)
6

Description

Hi,

Looking at the code, it seems the haversine algorithm used in [0] is faster (On My Machine) than the offical algorithm used in [1].
Is there reason it's not the official algorithm? Are there accuracy issues?

[0] https://github.com/uber/h3/blob/6c3c806ffbec16d32013bfa80ceec43b4c7513be/examples/distance.c#L39
[1] https://github.com/uber/h3/blob/6c3c806ffbec16d32013bfa80ceec43b4c7513be/src/h3lib/lib/geoCoord.c#L151

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the haversine implementation in examples/distance.c at line 39 with the official algorithm in src/h3lib/lib/geoCoord.c at line 151. Investigate the reported performance difference and any accuracy implications; done means the algorithm choice and its trade-offs are documented or the required change is clearly scoped.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.