object DistanceUtil
Util for distance related computation
- Alphabetic
- By Inheritance
- DistanceUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val DEGREES_TO_RADIANS: Double
- val RADIANS_TO_DEGREES: Double
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bearing(from: Location, to: Location): Double
-
def
bearing(from: jLocation, to: jLocation): Double
Formula: θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ ) where φ1,λ1 is the start point, φ2,λ2 the end point (Δλ is the difference in longitude) JavaScript: (all angles in radians) var y = Math.sin(λ2-λ1) * Math.cos(φ2); var x = Math.cos(φ1)*Math.sin(φ2) - Math.sin(φ1)*Math.cos(φ2)*Math.cos(λ2-λ1); var brng = Math.atan2(y, x).toDegrees();
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
val
ctx: SpatialContext
default SpatialContext implementation for geospatial.
- val degreesToMeters: Double
-
def
direction(bearing: Double): String
convert bearing to direction to East, West, North or South
-
def
direction_(bearing: Double): String
convert bearing to 16 different direction
-
def
distance(p1: Location, p2: Location): Double
distance in meters
-
def
distance(p1: jLocation, p2: jLocation): Double
distance in meters
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getGlobalCoordinateFromLatLon(origin: Location, pt: Location): Coordinate
-
def
getGlobalCoordinateFromLatLon(origin: jLocation, pt: jLocation): jCoordinate
def get_flat_earth_coord(origin, the_pt): """ Get the flat earth coordinates (x,y) from a given (lng,lat) point "pt".
def get_flat_earth_coord(origin, the_pt): """ Get the flat earth coordinates (x,y) from a given (lng,lat) point "pt". The (x,y) is the offset in lng and lat dimensions (in meters or km) from a given origin point (olng, olat)
Arguments: origin {list} -- (lng,lat) of the origin point pt {list} -- (lng,lat) of the point
Returns: [type] -- [description] """ vardx = ((origin[0] - the_pt[0]) * 40000.0 * math.cos((origin[1] + the_pt[1]) * math.pi / 360) / 360) vardy = (origin[1] - the_pt[1]) * 40000.0 / 360 return vardx, vardy
- def getLatLon(origin: Location, coor: Coordinate): Location
-
def
getLatLon(origin: jLocation, coor: jCoordinate): jLocation
Get the (lng, lat) from a given eucledian point (x,y).
Get the (lng, lat) from a given eucledian point (x,y). The origin point is given by origin_lnglat in (longitude, latitude) format. We assume (x,y) is "x" kilometers along longitude from the origin_lnglat, and "y" meters along the latitude. NOTE: (x,y) is in km from origin (and NOT in meters)
Arguments: origin_lnglat {list} -- The (longitude,latitude) of the origin point xy_pt {tuple} -- The (x,y) point (see above for details)
Returns: list -- The (longitude, latitude) of the (x,y) point
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
latLonWithinRange(location: Location): Boolean
lat >= -90.00 && lat <= 90.0 && lon >= -180.00 && lon <= 180.0
-
def
latLonWithinRange(location: jLocation): Boolean
lat >= -90.00 && lat <= 90.0 && lon >= -180.00 && lon <= 180.0
-
lazy val
log: Logger
init logger
init logger
- Annotations
- @transient()
- val metersToDegrees: Double
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
pointOnBearing(from: jLocation, distMeters: Double, bearingDEG: Double): jLocation
Calculates where a destination point is given an origin (
from
) distance, and bearing (given in degrees -- 0-360). -
def
pointOnBearing(from: Point, distDEG: Double, bearingDEG: Double): Point
Calculates where a destination point is given an origin (
from
) distance, and bearing (given in degrees -- 0-360). -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
val
sys: String
System.getProperty("os.name")
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated