case class LatitudeLongitude(lat: Double, long: Double) extends Product with Serializable
The LatitudeLongitude
class stores Latitude-Longitude coordinates.
- Alphabetic
- By Inheritance
- LatitudeLongitude
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
LatitudeLongitude(latDMS: (Int, Int, Int), longDMS: (Int, Int, Int))
Construct a
LatitudeLongitude
object from latitude and longitude as DMS strings.Construct a
LatitudeLongitude
object from latitude and longitude as DMS strings.- latDMS
the latitude in Degrees, Minutes, Seconds
- longDMS
the longitude in Degrees, Minutes, Seconds
-
new
LatitudeLongitude(latLong: (Double, Double))
Construct a
LatitudeLongitude
object from a pair of doubles.Construct a
LatitudeLongitude
object from a pair of doubles.- latLong
the pair of doubles
- new LatitudeLongitude(lat: Double, long: Double)
Value Members
-
def
distance(loc2: LatitudeLongitude, elevation: Double = 0.0): Double
Compute the distance between 'this' Latitude-Longitude and location 'loc2' in meters.
Compute the distance between 'this' Latitude-Longitude and location 'loc2' in meters.
- loc2
the other Latitude-Longitude location
- elevation
the average elevation for two locations (default 0 => sea level)
-
def
invalid: Boolean
Determine whether the latitude and longitude are valid.
-
def
kNearest(locs: Array[LatitudeLongitude], kappa: Int = 3): Array[(Int, Double)]
Find the 'kappa' nearest neighbors (top-'kappa') to the 'this' location, returning the indices and distances where they are found in 'locs'.
Find the 'kappa' nearest neighbors (top-'kappa') to the 'this' location, returning the indices and distances where they are found in 'locs'.
- locs
the other locations to be considered
- kappa
the number of nearest neighbors to collect
- val lat: Double
- val long: Double