PolyUtil

open class PolyUtil

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun containsLocation(point: LatLng, polygon: List<LatLng>, geodesic: Boolean): Boolean

open fun containsLocation(latitude: Double, longitude: Double, polygon: List<LatLng>, geodesic: Boolean): Boolean
Computes whether the given point lies inside the specified polygon.
Link copied to clipboard
open fun decode(encodedPath: String): List<LatLng>
Decodes an encoded path string into a sequence of LatLngs.
Link copied to clipboard
open fun distanceToLine(p: LatLng, start: LatLng, end: LatLng): Double
Computes the distance on the sphere between the point p and the line segment start to end.
Link copied to clipboard
open fun encode(path: List<LatLng>): String
Encodes a sequence of LatLngs into an encoded path string.
Link copied to clipboard
open fun isClosedPolygon(poly: List<LatLng>): Boolean
Returns true if the provided list of points is a closed polygon (i.e.
Link copied to clipboard
open fun isLocationOnEdge(point: LatLng, polygon: List<LatLng>, geodesic: Boolean): Boolean
Same as isLocationOnEdge with a default tolerance of 0.1 meters.
open fun isLocationOnEdge(point: LatLng, polygon: List<LatLng>, geodesic: Boolean, tolerance: Double): Boolean
Computes whether the given point lies on or near the edge of a polygon, within a specified tolerance in meters.
Link copied to clipboard
open fun isLocationOnPath(point: LatLng, polyline: List<LatLng>, geodesic: Boolean): Boolean
Same as isLocationOnPath with a default tolerance of 0.1 meters.
open fun isLocationOnPath(point: LatLng, polyline: List<LatLng>, geodesic: Boolean, tolerance: Double): Boolean
Computes whether the given point lies on or near a polyline, within a specified tolerance in meters.
Link copied to clipboard
open fun locationIndexOnEdgeOrPath(point: LatLng, poly: List<LatLng>, closed: Boolean, geodesic: Boolean, toleranceEarth: Double): Int
Computes whether (and where) a given point lies on or near a polyline, within a specified tolerance.
Link copied to clipboard
open fun locationIndexOnPath(point: LatLng, polyline: List<LatLng>, geodesic: Boolean): Int
Same as locationIndexOnPath with a default tolerance of 0.1 meters.
open fun locationIndexOnPath(point: LatLng, poly: List<LatLng>, geodesic: Boolean, tolerance: Double): Int
Computes whether (and where) a given point lies on or near a polyline, within a specified tolerance.
Link copied to clipboard
open fun simplify(poly: List<LatLng>, tolerance: Double): List<LatLng>
Simplifies the given poly (polyline or polygon) using the Douglas-Peucker decimation algorithm.