Class GeodesicSphereDistCalc
- java.lang.Object
-
- org.locationtech.spatial4j.distance.AbstractDistanceCalculator
-
- org.locationtech.spatial4j.distance.GeodesicSphereDistCalc
-
- All Implemented Interfaces:
DistanceCalculator
- Direct Known Subclasses:
GeodesicSphereDistCalc.Haversine
,GeodesicSphereDistCalc.LawOfCosines
,GeodesicSphereDistCalc.Vincenty
public abstract class GeodesicSphereDistCalc extends AbstractDistanceCalculator
A base class for a Distance Calculator that assumes a spherical earth model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeodesicSphereDistCalc.Haversine
static class
GeodesicSphereDistCalc.LawOfCosines
static class
GeodesicSphereDistCalc.Vincenty
-
Constructor Summary
Constructors Constructor Description GeodesicSphereDistCalc()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description double
area(Circle circle)
double
area(Rectangle rect)
Rectangle
calcBoxByDistFromPt(Point from, double distDEG, SpatialContext ctx, Rectangle reuse)
Calculates the bounding box of a circle, as specified by its center point and distance.double
calcBoxByDistFromPt_yHorizAxisDEG(Point from, double distDEG, SpatialContext ctx)
TheY
coordinate of the horizontal axis of a circle that has maximum width.double
distance(Point from, double toX, double toY)
The distance betweenfrom
andPoint(toX,toY)
.protected abstract double
distanceLatLonRAD(double lat1, double lon1, double lat2, double lon2)
boolean
equals(Object obj)
int
hashCode()
Point
pointOnBearing(Point from, double distDEG, double bearingDEG, SpatialContext ctx, Point reuse)
Calculates where a destination point is given an origin (from
) distance, and bearing (given in degrees -- 0-360).-
Methods inherited from class org.locationtech.spatial4j.distance.AbstractDistanceCalculator
distance, toString, within
-
-
-
-
Method Detail
-
pointOnBearing
public Point pointOnBearing(Point from, double distDEG, double bearingDEG, SpatialContext ctx, Point reuse)
Description copied from interface:DistanceCalculator
Calculates where a destination point is given an origin (from
) distance, and bearing (given in degrees -- 0-360). If reuse is given, then this method may reset() it and return it.
-
calcBoxByDistFromPt
public Rectangle calcBoxByDistFromPt(Point from, double distDEG, SpatialContext ctx, Rectangle reuse)
Description copied from interface:DistanceCalculator
Calculates the bounding box of a circle, as specified by its center point and distance.
-
calcBoxByDistFromPt_yHorizAxisDEG
public double calcBoxByDistFromPt_yHorizAxisDEG(Point from, double distDEG, SpatialContext ctx)
Description copied from interface:DistanceCalculator
TheY
coordinate of the horizontal axis of a circle that has maximum width. On a 2D plane, this result is alwaysfrom.getY()
but, perhaps surprisingly, on a sphere it is going to be slightly different.
-
area
public double area(Rectangle rect)
-
area
public double area(Circle circle)
-
distance
public final double distance(Point from, double toX, double toY)
Description copied from interface:DistanceCalculator
The distance betweenfrom
andPoint(toX,toY)
.
-
distanceLatLonRAD
protected abstract double distanceLatLonRAD(double lat1, double lon1, double lat2, double lon2)
-
-