LineString
public struct LineString : Equatable
Undocumented
-
Undocumented
Declaration
Swift
public var coordinates: [CLLocationCoordinate2D]
-
Undocumented
Declaration
Swift
public init(_ coordinates: [CLLocationCoordinate2D])
-
Undocumented
Declaration
Swift
public init(_ ring: Ring)
-
Returns a
.LineString
along a.LineString
within a distance from a coordinate.Declaration
Swift
public func trimmed(from coordinate: CLLocationCoordinate2D, distance: CLLocationDistance) -> LineString?
-
See moreIndexedCoordinate
is a coordinate with additional information such as the index from its position in the polyline and distance from the start of the polyline.Declaration
Swift
public struct IndexedCoordinate
-
Returns a coordinate along a
.LineString
at a certain distance from the start of the polyline.Declaration
Swift
public func coordinateFromStart(distance: CLLocationDistance) -> CLLocationCoordinate2D?
-
Returns an indexed coordinate along a
.LineString
at a certain distance from the start of the polyline.Ported from https://github.com/Turfjs/turf/blob/142e137ce0c758e2825a260ab32b24db0aa19439/packages/turf-along/index.js
Declaration
Swift
public func indexedCoordinateFromStart(distance: CLLocationDistance) -> IndexedCoordinate?
-
Returns the distance along a slice of a
.LineString
with the given endpoints.Declaration
Swift
public func distance(from start: CLLocationCoordinate2D? = nil, to end: CLLocationCoordinate2D? = nil) -> CLLocationDistance?
-
Returns a subset of the
.LineString
between given coordinates.Declaration
Swift
public func sliced(from start: CLLocationCoordinate2D? = nil, to end: CLLocationCoordinate2D? = nil) -> LineString?
-
Returns the geographic coordinate along the
.LineString
that is closest to the given coordinate as the crow flies. The returned coordinate may not correspond to one of the polyline’s vertices, but it always lies along the polyline.Declaration
Swift
public func closestCoordinate(to coordinate: CLLocationCoordinate2D) -> IndexedCoordinate?