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

Karl Wright commented on LUCENE-6487:
-------------------------------------

What I propose to do is introduce a planet model, as follows:

{code}
public class PlanetModel {
  
  // Surface of the planet:
  // x^2/a^2 + y^2/b^2 + z^2/c^2 = 1.0
  // Scaling factors are a,b,c.
  public final double inverseA;
  public final double inverseB;
  public final double inverseC;
  public final double inverseASquared;
  public final double inverseBSquared;
  public final double inverseCSquared;
  // We do NOT include radius, because all computations in geo3d are in 
radians, not meters.
  
  /** Planet model corresponding to sphere. */
  public static final PlanetModel SPHERE = new PlanetModel(1.0,1.0,1.0);
  /** Planet model corresponding to WGS84 */
  public final static double WGS84_FLATTENING = 1.0/298.257223563;
  // For WGS84, the flattening is applied how?  Given we still want to scale by 
mean earth radius in meters, what gets scaled
  // and how?  Ask Nicholas.
  public static final PlanetModel WGS84 = new PlanetModel(1.0 - 
WGS84_FLATTENING, 1.0 - WGS84_FLATTENING, 1.0);
  
  public PlanetModel(final double a, final double b, final double c) {
    this.inverseA = 1.0 / a;
    this.inverseB = 1.0 / b;
    this.inverseC = 1.0 / c;
    this.inverseASquared = inverseA * inverseA;
    this.inverseBSquared = inverseB * inverseB;
    this.inverseCSquared = inverseC * inverseC;
  }
  
}
{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
>
> 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