lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Ingersoll (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENE-2519) SinusoidalProjection returns the incorrect results
Date Tue, 29 Jun 2010 16:06:51 GMT
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message