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

Karl Wright commented on LUCENE-6578:
-------------------------------------

The distance calculator interface would look then like this:

{code}
public interface DistanceStyle {
  
  /** Compute the distance from a point to another point.
   * @param point1 Starting point
   * @param point2 Final point
   * @return the distance
   */
  public double computeDistance(final GeoPoint point1, final GeoPoint point2);
  
  /** Compute the distance from a point to another point.
   * @param point1 Starting point
   * @param x2 Final point x
   * @param y2 Final point y
   * @param z2 Final point z
   * @return the distance
   */
  public double computeDistance(final GeoPoint point1, final double x2, final 
double y2, final double z2);

  /** Compute the distance from a plane to a point.
   * @param planetModel The planet model
   * @param plane The plane
   * @param point The point
   * @return the distance
   */
  public double computeDistance(final PlanetModel planetModel, final Plane 
plane, final GeoPoint point);
  
  /** Compute the distance from a plane to a point.
   * @param planetModel The planet model
   * @param plane The plane
   * @param x The point x
   * @param y The point y
   * @param z The point z
   * @return the distance
   */
  public double computeDistance(final PlanetModel planetModel, final Plane 
plane, final double x, final double y, final double z);

}
{code}



> Geo3d: arcDistanceToShape() method may be useful
> ------------------------------------------------
>
>                 Key: LUCENE-6578
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6578
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/spatial
>            Reporter: Karl Wright
>         Attachments: LUCENE-6578.patch, LUCENE-6578.revised.patch
>
>
> I've got an application that seems like it may need the ability to compute a 
> new kind of arc distance, from a GeoPoint to the nearest edge/point of a 
> GeoShape.  Adding this method to the interface, and corresponding 
> implementations, would increase the utility of the package for ranking 
> purposes.



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