Coordinate

com.phasmidsoftware.xmldoc.kml.Coordinate
See theCoordinate companion object
case class Coordinate(long: String, lat: String, maybeAlt: Option[String])

Case class Coordinate to represent a three-dimensional point. Although this is part of the KML spec, it is treated somewhat differently than the others.

Value parameters

lat

latitude.

long

longitude.

maybeAlt

altitude: optional per the KML spec (a 2-value "long,lat" tuple is valid KML), kept as Option rather than defaulted so that round-tripping a coordinate that omitted altitude doesn't fabricate an explicit "0" that was never there.

Attributes

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

Members list

Value members

Concrete methods

infix def distance(c: Coordinate): Option[Double]

Calculates the distance between the current Coordinate instance and another given Coordinate instance.

Calculates the distance between the current Coordinate instance and another given Coordinate instance.

The distance is computed using the Cartesian coordinates of both instances, provided that they can be successfully converted to their Cartesian representation. If either coordinate cannot be converted, the result will be None.

Value parameters

c

the Coordinate instance to calculate the distance to.

Attributes

Returns

an Option[Double] representing the Euclidean distance between the two coordinates, or None if the Cartesian conversion fails for either of the coordinates.

infix def vector(c: Coordinate): Option[Cartesian]

Computes the vector difference between the current Coordinate instance and another given Coordinate instance.

Computes the vector difference between the current Coordinate instance and another given Coordinate instance.

Value parameters

c

a Coordinate instance for which the vector difference is calculated with respect to the current instance.

Attributes

Returns

an Option[Cartesian] representing the vector difference if both coordinates can be converted to Cartesian, otherwise None.

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 geometry: Option[Cartesian]

Represents the Cartesian coordinate of the current instance of Coordinate.

Represents the Cartesian coordinate of the current instance of Coordinate.

This value is lazily computed and will return an Option[Cartesian] if the long and lat fields of this instance can be successfully converted to Double (a missing or unparseable altitude defaults to 0, per the KML spec). If either of the other conversions fail, the result is None.

Attributes