isLocationOnEdge

fun isLocationOnEdge(point: LatLng, polygon: List<LatLng>, geodesic: Boolean, tolerance: Double = DEFAULT_TOLERANCE): Boolean

Computes whether the given point lies on or near the edge of a polygon, within a specified tolerance in meters. The polygon edge is composed of great circle segments if geodesic is true, and of Rhumb segments otherwise. The polygon edge is implicitly closed -- the closing segment between the first point and the last point is included.

Return

true if the point is on the edge of the polygon, false otherwise.

Parameters

point

The point to check.

polygon

The polygon to check against.

geodesic

Whether to treat the polygon segments as geodesic or rhumb lines.

tolerance

The tolerance in meters.