com.amap.api.maps.utils

## 类 SpatialRelationUtil

- java.lang.Object
- - com.amap.api.maps.utils.SpatialRelationUtil

-     public class SpatialRelationUtil
      extends java.lang.Object

  计算点到线最短距离工具类
  Tool class for calculating the shortest distance from a point to a line
  从以下版本开始:
    4.1.3

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static int` | `A_CIRCLE_DEGREE`
    `static int` | `A_HALF_CIRCLE_DEGREE`
    `static int` | `MIN_OFFSET_DEGREE`
    `static int` | `MIN_POLYLINE_POINT_SIZE`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static android.util.Pair<java.lang.Integer,com.autonavi.amap.mapcore.DPoint>` | `calShortestDistancePoint(java.util.List<com.autonavi.amap.mapcore.DPoint> points, com.autonavi.amap.mapcore.DPoint point)` 计算一个点在线上的垂足，如果垂足在线上的某一顶点，则直接返回顶点的下标 Calculate the foot of a perpendicular from a point to a line, if the foot is at a vertex of the line, directly return the index of the vertex
    `static android.util.Pair<java.lang.Integer,com.autonavi.amap.mapcore.DPoint>` | `calShortestDistancePoint(java.util.List<com.autonavi.amap.mapcore.DPoint> points, com.autonavi.amap.mapcore.DPoint point, float bearing)`
    `static android.util.Pair<java.lang.Integer,LatLng>` | `calShortestDistancePoint(java.util.List<LatLng> points, LatLng point)` 计算一个点在线上的垂足，如果垂足在线上的某一顶点，则直接返回顶点的下标 Calculate the foot of a perpendicular from a point to a line, if the foot is at a vertex of the line, directly return the index of the vertex
    `static android.util.Pair<java.lang.Integer,LatLng>` | `calShortestDistancePoint(java.util.List<LatLng> points, LatLng point, float bearing, double distance)`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### MIN_POLYLINE_POINT_SIZE

          public static final int MIN_POLYLINE_POINT_SIZE

      另请参阅:
        常量字段值

    - #### A_HALF_CIRCLE_DEGREE

          public static final int A_HALF_CIRCLE_DEGREE

      另请参阅:
        常量字段值

    - #### A_CIRCLE_DEGREE

          public static final int A_CIRCLE_DEGREE

      另请参阅:
        常量字段值

    - #### MIN_OFFSET_DEGREE

          public static final int MIN_OFFSET_DEGREE

      另请参阅:
        常量字段值

  - ### 方法详细资料

    - #### calShortestDistancePoint

          public static android.util.Pair<java.lang.Integer,LatLng> calShortestDistancePoint(java.util.List<LatLng> points,
                                                                                             LatLng point,
                                                                                             float bearing,
                                                                                             double distance)

    - #### calShortestDistancePoint

          public static android.util.Pair<java.lang.Integer,LatLng> calShortestDistancePoint(java.util.List<LatLng> points,
                                                                                             LatLng point)

      计算一个点在线上的垂足，如果垂足在线上的某一顶点，则直接返回顶点的下标
      Calculate the foot of a perpendicular from a point to a line, if the foot is at a vertex of the line, directly return the index of the vertex
      参数:
        `points` - 坐标数组
        Coordinate array
        `point` - 坐标点
        Coordinate point
      返回:
      从以下版本开始:
        4.1.3

    - #### calShortestDistancePoint

          public static android.util.Pair<java.lang.Integer,com.autonavi.amap.mapcore.DPoint> calShortestDistancePoint(java.util.List<com.autonavi.amap.mapcore.DPoint> points,
                                                                                                                       com.autonavi.amap.mapcore.DPoint point)

      计算一个点在线上的垂足，如果垂足在线上的某一顶点，则直接返回顶点的下标
      Calculate the foot of a perpendicular from a point to a line, if the foot is at a vertex of the line, directly return the index of the vertex
      参数:
        `points` - DPoint 数组
        DPoint array
        `point` -
      返回:
      从以下版本开始:
        4.1.3

    - #### calShortestDistancePoint

          public static android.util.Pair<java.lang.Integer,com.autonavi.amap.mapcore.DPoint> calShortestDistancePoint(java.util.List<com.autonavi.amap.mapcore.DPoint> points,
                                                                                                                       com.autonavi.amap.mapcore.DPoint point,
                                                                                                                       float bearing)