[ 
https://issues.apache.org/jira/browse/LUCENE-6487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14564851#comment-14564851
 ] 

David Smiley commented on LUCENE-6487:
--------------------------------------

I rewrote the test; and indirectly test the arcDistance somewhat since it calls 
that.  Can you try this?  It seems my error epsilons are too tiny.  Or maybe 
you see something the matter.
{code:java}

  @Test
  public void testConversion() {
    testPointRoundTrip(PlanetModel.SPHERE, 90, 0, 1e-12);
    testPointRoundTrip(PlanetModel.SPHERE, -90, 0, 1e-12);
    testPointRoundTrip(PlanetModel.WGS84, 90, 0, 1e-12);
    testPointRoundTrip(PlanetModel.WGS84, -90, 0, 1e-12);

    final double pLat = (randomFloat() * 180.0 - 90.0) * 
DistanceUtils.DEGREES_TO_RADIANS;
    final double pLon = (randomFloat() * 360.0 - 180.0) * 
DistanceUtils.DEGREES_TO_RADIANS;
    testPointRoundTrip(PlanetModel.SPHERE, pLat, pLon, 1e-12);
    testPointRoundTrip(PlanetModel.WGS84, pLat, pLon, 1e-6);//bigger error 
tolerance
  }

  protected void testPointRoundTrip(PlanetModel planetModel, double pLat, 
double pLon, double epsilon) {
    final GeoPoint p1 = new GeoPoint(planetModel, pLat, pLon);
    final GeoPoint p2 = new GeoPoint(planetModel, p1.getLatitude(), 
p1.getLongitude());
    double dist = p1.arcDistance(p2);
    assertEquals(0, dist, epsilon);
  }

{code}

> Add WGS84 capability to geo3d support
> -------------------------------------
>
>                 Key: LUCENE-6487
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6487
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/spatial
>            Reporter: Karl Wright
>         Attachments: LUCENE-6487.patch, LUCENE-6487.patch, LUCENE-6487.patch, 
> LUCENE-6487.patch
>
>
> WGS84 compatibility has been requested for geo3d.  This involves working with 
> an ellipsoid rather than a unit sphere.  The general formula for an ellipsoid 
> is:
> x^2/a^2 + y^2/b^2 + z^2/c^2 = 1



--
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