[ 
https://issues.apache.org/jira/browse/LUCENE-7123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Muir updated LUCENE-7123:
--------------------------------
    Attachment: LUCENE-7123.patch

Here is a patch:
* adds haversinMeters to SloppyMath and cuts everything over to it.
* adds a test that this is within 0.01MM of the actual haversin result (if you 
were to use slower trig functions).
* moves out sin/tan stuff to the geoutils class that is using it. There is a 
TODO to remove these further.

I did benchmarking and testing as well. I think its ready.

> deduplicate/cleanup spatial distance
> ------------------------------------
>
>                 Key: LUCENE-7123
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7123
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-7123.patch
>
>
> Currently there is a bit of a mess here: SloppyMath.haversin is slightly 
> different from GeoDistanceUtils.haversin, the latter is actually slightly 
> faster and uses a simple fixed earth diameter (which makes calculations 
> easier too).
> But one of these returns meters, the other kilometers. Furthermore 
> lucene/spatial now uses some sin/tan functions that were added to sloppymath 
> with some accuracy guarantees (which are untested, and not quite correct). 
> Lucene/spatial queries also inconsistently mix the two different functions 
> together for various purposes and this just causes headaches. Its tests did 
> this recently too.
> We need to clean this up, otherwise users will be confused. E.G. they will 
> see different results from expressions than from queries and not understand.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to