[
https://issues.apache.org/jira/browse/LUCENE-2519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883596#action_12883596
]
Chris Male commented on LUCENE-2519:
------------------------------------
+1
Fix makes sense and follows the alg described in wikipedia and found in jhlabs.
> SinusoidalProjection returns the incorrect results
> --------------------------------------------------
>
> Key: LUCENE-2519
> URL: https://issues.apache.org/jira/browse/LUCENE-2519
> Project: Lucene - Java
> Issue Type: Bug
> Components: contrib/spatial
> Reporter: Grant Ingersoll
>
> Currently, the SinusoidalProjection does:
> {code}
> public double[] coords(double latitude, double longitude) {
> double rlat = Math.toRadians(latitude);
> double rlong = Math.toRadians(longitude);
> double nlat = rlong * Math.cos(rlat);
> return new double[]{nlat, rlong};
>
> }
> {code}
> But the correct formula (from
> http://en.wikipedia.org/wiki/Sinusoidal_projection) is:
> {quote}
> x = (gamma - gamma[0]) cos(phi)
> y = phi
> {quote}
> where gamma[0] is assumed to be the prime meridian in this case (0), gamma is
> the incoming longitude and phi is the latitude
> Thus, the above code should return:
> {quote}
> {nlat, rlat}
> {quote}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]