PointCoordinates
open class PointCoordinates : ListBase, Sequence, @unchecked Sendable
Represents an N-dimensional point.
Note that some coordinate reference systems will support only x and y dimensions.
-
Undocumented
Declaration
Swift
public subscript(index: Int) -> Double { get set } -
An immutable empty
PointCoordinates.Declaration
Swift
public static let empty: PointCoordinates -
Construct a new list with
lengthof zero and optional initialcapacity. A list can expand in length beyond its initial capacity, but best performance will be obtained if the initial capacity is close to (and not less than) the list’s maximum length.Declaration
Swift
override public init(capacity: Int = (4 as Int))Parameters
capacityOptional initial capacity.
-
Synonym for
z.Declaration
Swift
open var altitude: Double { get set } -
Add
itemto the end of this list.Declaration
Swift
public final func append(_ item: Double)Parameters
itemItem to be added.
-
Add all the items of
listto the end of this list.Declaration
Swift
public final func append(contentsOf list: PointCoordinates)Parameters
listItems to be added.
-
Declaration
Swift
public final func copy() -> PointCoordinatesReturn Value
A shallow copy of this list.
-
Declaration
Swift
override open func copyMutable() -> DataValueReturn Value
A clone of this value if it (together with all value subcomponents) is possibly mutable, or return
selfvalue if it (together with all value subcomponents) is definitely immutable. The resulting value might share mutable metadata with this query. -
Declaration
Swift
public final func filter(_ predicate: @escaping (Double) -> Bool) -> PointCoordinatesParameters
predicateFunction to be applied to each item of this list. Items matching this predicate will be returned in the new list.
Return Value
A new list which contains the items of this list that match a specified predicate function. Ordering is preserved.
-
Throws
EmptyListExceptionif the list is empty.Declaration
Swift
public final func first() -> DoubleReturn Value
The first item in this list.
-
Convert array to list.
Declaration
Swift
open class func fromArray(_ array: Array<Double>) -> PointCoordinatesParameters
arrayArray with source items.
Return Value
New list with items copied from
arrayparameter. -
Declaration
Swift
public final func includes(item: Double) -> BoolParameters
itemItem for comparison. Comparison uses the
equalityproperty, which would usually be expected to match the==operator for item typedouble.Return Value
trueif this list containsitem. -
Declaration
Swift
public final func indexOf(item: Double, start: Int = (0 as Int)) -> IntParameters
itemItem for comparison. Comparison uses the
equalityproperty, which would usually be expected to match the==operator for item typedouble.startZero-based starting index (search moves forwards from this index).
Return Value
First index in this list of
item, or-1if not found. -
Insert
iteminto this list, before the item (if any) atindex.Throws
ListIndexExceptionifindexis out of range (0 tolength).Declaration
Swift
public final func insert(at index: Int, item: Double)Parameters
indexZero-based index.
itemItem to be added.
-
Insert all items of
listinto this list, before the item (if any) atindex.Throws
ListIndexExceptionifindexis out of range (0 tolength).Declaration
Swift
public final func insert(at index: Int, contentsOf list: PointCoordinates)Parameters
indexZero-based index.
listList of items to be inserted.
-
Throws
ListIndexExceptionifindexis out of range (0 tolength- 1).Declaration
Swift
public final func item(at index: Int) -> DoubleParameters
indexZero-based index.
Return Value
The item in this list at the specified
index. -
Throws
EmptyListExceptionif the list is empty.Declaration
Swift
public final func last() -> DoubleReturn Value
The last item in this list.
-
Declaration
Swift
public final func lastIndexOf(item: Double, start: Int = (2147483647 as Int)) -> IntParameters
itemItem for comparison. Comparison uses the
equalityproperty, which would usually be expected to match the==operator for item typedouble.startZero-based starting index (search moves backwards from this index).
Return Value
Last index in this list of
item, or-1if not found. -
Synonym for
y.Declaration
Swift
open var latitude: Double { get set } -
Synonym for
x.Declaration
Swift
open var longitude: Double { get set } -
The
Mdimension (e.g. measure). Equivalent tothis.last(). UsewithXYMorwithXYZMto obtain point coordinates with anMdimension.Declaration
Swift
open var m: Double { get } -
Declaration
Swift
open func makeIterator() -> IndexingIterator<Array<Double>>Return Value
This list converted to a Swift iterator.
-
Synonym for
m.Declaration
Swift
open var measure: Double { get } -
Declaration
Swift
open class func of(_ items: Double...) -> PointCoordinatesParameters
rest_itemsItems for the resulting list.
Return Value
A new list of item type
double, containing the specifieditems. -
See also
copy,reverse.Declaration
Swift
open func reversed() -> PointCoordinatesReturn Value
a reversed copy of this list.
-
Return a new
PointCoordinatesthat shares theListBase.untypedListas thelistparameter. To ensure type safety, items inlistthat do not have the item typedoublewill be removed.Declaration
Swift
open class func share(_ list: ListBase) -> PointCoordinatesParameters
listList whose items will be shared by the resulting list.
Return Value
A new list of item type
double, sharing the same items aslist. -
Throws
EmptyListExceptionif the list has no items,NotUniqueExceptionif the list has multiple items.Declaration
Swift
public final func single() -> DoubleReturn Value
A single item from this list.
-
Declaration
Swift
public final func slice(start: Int, end: Int = (2147483647 as Int)) -> PointCoordinatesParameters
startZero-based starting index (inclusive), or negative for starting index relative to the end of this list.
endZero-based ending index (exclusive), or negative for ending index relative to the end of this list.
Return Value
A slice of this list from index
start(inclusive) to indexend(exclusive). -
Sort this list in place (stable sort, O(n log n) complexity).
See also
copy,sort.Declaration
Swift
public final func sort(by increasing: @escaping (Double, Double) -> Bool)Parameters
increasingPredicate that returns
trueif its first argument should preceed its second argument in the desired ordering. -
See also
copy,sort.Declaration
Swift
public final func sorted() -> PointCoordinatesReturn Value
a sorted copy of this list using this list’s default
comparerfor ordering (stable sort, O(n log n) complexity). -
See also
copy,sortBy.Declaration
Swift
public final func sorted(by increasing: @escaping (Double, Double) -> Bool) -> PointCoordinatesParameters
increasingPredicate that returns
trueif its first argument should preceed its second argument in the desired ordering.Return Value
a sorted copy of this list (stable sort, O(n log n) complexity).
-
Declaration
Swift
open func toArray() -> Array<Double>Return Value
This list converted to a Swift array.
-
Set the item in this list at the specified
index.Declaration
Swift
public final func update(at index: Int, item: Double)Parameters
indexZero-based index.
itemItem value.
-
Declaration
Swift
open class func with(x: Double, y: Double) -> PointCoordinatesParameters
xX-coordinate (longitude for geography points).
yY-coordinate (latitude for geography points).
Return Value
2D point coordinates.
-
Declaration
Swift
open class func with(x: Double, y: Double, m: Double) -> PointCoordinatesParameters
xX-coordinate (longitude for geography points).
yY-coordinate (latitude for geography points).
mM-coordinate (measure).
Return Value
2D point coordinates with measure.
-
Declaration
Swift
open class func with(x: Double, y: Double, z: Double) -> PointCoordinatesParameters
xX-coordinate (longitude for geography points).
yY-coordinate (latitude for geography points).
zZ-coordinate (altitude for geography points).
Return Value
3D point coordinates.
-
Declaration
Swift
open class func with(x: Double, y: Double, z: Double, m: Double) -> PointCoordinatesParameters
xX-coordinate (longitude for geography points).
yY-coordinate (latitude for geography points).
zZ-coordinate (altitude for geography points).
mM-coordinate (measure).
Return Value
3D point coordinates with measure.
-
Declaration
Swift
open class func with(latitude: Double, longitude: Double) -> PointCoordinatesParameters
latitudeLatitude (Y-coordinate).
longitudeLongitude (X-coordinate).
Return Value
2D point coordinates.
-
The
Xdimension (e.g. longitude). Equivalent tothis.get(0).Declaration
Swift
open var x: Double { get set } -
The
Ydimension (e.g. latitude). Equivalent tothis.get(1).Declaration
Swift
open var y: Double { get set } -
The
Zdimension (e.g. altitude). Equivalent tothis.get(2).Declaration
Swift
open var z: Double { get set }