spatial4j icon indicating copy to clipboard operation
spatial4j copied to clipboard

WithinDistanceCalculator

Open dsmiley opened this issue 11 years ago • 1 comments

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.

dsmiley avatar May 06 '14 18:05 dsmiley

It's good to add WithinDistanceCalculator. When user set DistanceCalculator in SpatialContext, you need make sure within check will uses WithinDistanceCalculator automatically.

yozhao avatar May 07 '14 03:05 yozhao