locationtech / locationtech/spatial4j

WithinDistanceCalculator

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

Nobody has claimed this yet.

API enhancement
Dominant language
Java
Stars
961
Forks
172
PR merge metrics
No merged PRs in 30d

Description

For most distance calculation methods, there is redundant math being performed when the formula is being used to check if a point is within a circle, many times over. Addressing this is an API issue. The DistanceCalculator abstraction as it is currently formed isn't so great. Perhaps instead it should be named WithinDistanceCalculator and you initialize it with a point and distance. Not only would LawOfCosines benefit, but the others would too.

See #80.

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

Start by reading the DistanceCalculator abstraction and the LawOfCosines implementation, then review the related discussion in issue #80. Compare the distance calculation methods to identify the repeated work involved in within-circle checks. Done means the API direction is settled and the affected calculators consistently support the proposed within-distance use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.