/tripkit/CommonCoreLegacy/com.skedgo.tripkit.common.util/PolyUtil
PolyUtil
\ open class PolyUtil
Functions
Name | Summary |
---|---|
containsLocation | open fun containsLocation(point: TripKitLatLng, polygon: List<TripKitLatLng>, geodesic: Boolean): Boolean open fun containsLocation(latitude: Double, longitude: Double, polygon: List<TripKitLatLng>, geodesic: Boolean): Boolean Computes whether the given point lies inside the specified polygon. |
decode | open fun decode(encodedPath: String): List<TripKitLatLng> Decodes an encoded path string into a sequence of TripKitLatLngs. |
distanceToLine | open fun distanceToLine(p: TripKitLatLng, start: TripKitLatLng, end: TripKitLatLng): Double Computes the distance on the sphere between the point p and the line segment start to end. |
encode | open fun encode(path: List<TripKitLatLng>): String Encodes a sequence of TripKitLatLngs into an encoded path string. |
isClosedPolygon | open fun isClosedPolygon(poly: List<TripKitLatLng>): Boolean Returns true if the provided list of points is a closed polygon (i.e. |
isLocationOnEdge | open fun isLocationOnEdge(point: TripKitLatLng, polygon: List<TripKitLatLng>, geodesic: Boolean): Boolean Same as isLocationOnEdge with a default tolerance of 0.1 meters. open fun isLocationOnEdge(point: TripKitLatLng, polygon: List<TripKitLatLng>, 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. |
isLocationOnPath | open fun isLocationOnPath(point: TripKitLatLng, polyline: List<TripKitLatLng>, geodesic: Boolean): Boolean Same as isLocationOnPath with a default tolerance of 0.1 meters. open fun isLocationOnPath(point: TripKitLatLng, polyline: List<TripKitLatLng>, geodesic: Boolean, tolerance: Double): Boolean Computes whether the given point lies on or near a polyline, within a specified tolerance in meters. |
locationIndexOnEdgeOrPath | open fun locationIndexOnEdgeOrPath(point: TripKitLatLng, poly: List<TripKitLatLng>, closed: Boolean, geodesic: Boolean, toleranceEarth: Double): Int Computes whether (and where) a given point lies on or near a polyline, within a specified tolerance. |
locationIndexOnPath | open fun locationIndexOnPath(point: TripKitLatLng, polyline: List<TripKitLatLng>, geodesic: Boolean): Int Same as locationIndexOnPath with a default tolerance of 0.1 meters. open fun locationIndexOnPath(point: TripKitLatLng, poly: List<TripKitLatLng>, geodesic: Boolean, tolerance: Double): Int Computes whether (and where) a given point lies on or near a polyline, within a specified tolerance. |
simplify | open fun simplify(poly: List<TripKitLatLng>, tolerance: Double): List<TripKitLatLng> Simplifies the given poly (polyline or polygon) using the Douglas-Peucker decimation algorithm. |