Coordinates

com.phasmidsoftware.xmldoc.kml.Coordinates
See theCoordinates companion object
case class Coordinates(coordinates: Seq[Coordinate]) extends Mergeable[Coordinates]

Represents a sequence of Coordinate objects and provides operations for merging, reversing, and computing geometric properties such as gaps and directions. See Linear Ring coordinates

Value parameters

coordinates

A sequence of Coordinate objects representing this collection.

Attributes

Constructor

Creates an instance of Coordinates with the specified sequence of Coordinate objects.

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def gap(other: Coordinates): Option[Double]

Computes the gap (distance) between this Coordinates instance and another Coordinates instance, if possible.

Computes the gap (distance) between this Coordinates instance and another Coordinates instance, if possible.

Value parameters

other

the other Coordinates instance to compute the gap with

Attributes

Returns

an Option containing the distance as a Double, or None if the distance cannot be calculated

infix def merge(other: Coordinates, mergeName: Boolean = ...): Option[Coordinates]

Merges this Coordinates instance with another Coordinates instance.

Merges this Coordinates instance with another Coordinates instance.

The result is oriented the same way as this (this's own direction is authoritative and it always comes first) - other is attached at whichever of its own ends is closer to this one's last coordinate, reversing it first if that yields a closer join (Issue #54: previously, this only ever compared the two straight concatenations, this++other vs other++this, so a pair of lines that should join end-to-end or start-to-start - needing a reversal - was never actually found).

Value parameters

mergeName

a boolean indicating whether to merge the names of the two Coordinates instances. Defaults to true.

other

the other Coordinates instance to be merged with this instance.

Attributes

Returns

an Option containing the resulting merged Coordinates, or None if the merge cannot be performed.

Reverses the order of the coordinates contained in this Coordinates instance. TESTME

Reverses the order of the coordinates contained in this Coordinates instance. TESTME

Attributes

Returns

a new Coordinates instance with the coordinates in reversed order.

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product

Concrete fields

lazy val direction: Option[Double]

Computes the direction as the distance between the first and last coordinates in this Coordinates instance, if possible.

Computes the direction as the distance between the first and last coordinates in this Coordinates instance, if possible.

This value is computed lazily and is wrapped in an Option. The computation involves retrieving the first and last coordinates from the sequence of coordinates within the Coordinates instance. If either the first or last coordinate is missing, or if the distance between them cannot be computed, the result will be None. TESTME

Attributes

Returns

an Option containing the computed distance as a Double, or None if the distance cannot be determined.