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.
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.
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.