Package provided.owlMaps.utils.impl
Class AOwlMapUtils
java.lang.Object
provided.owlMaps.utils.impl.AOwlMapUtils
- All Implemented Interfaces:
IOwlMapUtils
public abstract class AOwlMapUtils extends java.lang.Object implements IOwlMapUtils
Abstract implementation of IOwlMapUtils
- Author:
- swong
-
Constructor Summary
Constructors Constructor Description AOwlMapUtils()
-
Method Summary
Modifier and Type Method Description IPath<ILatLng>
convertPointsToLatLng(ILatLng originLatLng, IPath<java.awt.geom.Point2D> pts)
Convert a path of Point2D's to a path of ILatLng where the points are relative to the given origin location.IPaths<ILatLng>
convertPointsToLatLng(ILatLng originLatLng, IPaths<java.awt.geom.Point2D> pts)
Convert paths of Point2D's to paths of ILatLng where the points are relative to the given origin location.double
getEarthEquatorialRadius()
Get the Earth's radius at the equator in the units currently used by the system.double
getEarthMeanRadius()
Get the mean Earth radius in the units currently used by the system.double
getEarthPolarRadius()
Get the Earth's radius at the poles in the units currently used by the system.double
getEarthRadius(double lat)
Get the Earth's radius at the given latitude.double
getLatFactor(double lat)
Get the length per degree factor for length per degree in a fixed latitude line at the given latitude.ILatLng
getLatLngRelativeTo(ILatLng originLatLng, java.awt.geom.Point2D pt)
Get the ILatLng that is the vector distance from the given origin ILatLng Assumes that the distances involved are small relative to the size of the Earth or errors will occur due to the ellipsoidal nature of the globe.double
getLngFactor(double lat)
Get the small angle approximation for the length per degree of factor for distances along a fixed longitude line at the given latitude.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface provided.owlMaps.utils.IOwlMapUtils
getSystemLengthUnit
-
Constructor Details
-
AOwlMapUtils
public AOwlMapUtils()
-
-
Method Details
-
convertPointsToLatLng
public IPath<ILatLng> convertPointsToLatLng(ILatLng originLatLng, IPath<java.awt.geom.Point2D> pts)Description copied from interface:IOwlMapUtils
Convert a path of Point2D's to a path of ILatLng where the points are relative to the given origin location. Assumes that the distances involved are small relative to the size of the Earth or errors will occur due to the ellipsoidal nature of the globe. Units are in the currently used system length units.- Specified by:
convertPointsToLatLng
in interfaceIOwlMapUtils
- Parameters:
originLatLng
- The ILatLng designating the originpts
- path of points relative to the originLatLng- Returns:
- An IPath of ILatLngs
-
convertPointsToLatLng
public IPaths<ILatLng> convertPointsToLatLng(ILatLng originLatLng, IPaths<java.awt.geom.Point2D> pts)Description copied from interface:IOwlMapUtils
Convert paths of Point2D's to paths of ILatLng where the points are relative to the given origin location. Paths could be a simple IPath or a compound IPaths (path of paths) of points. Assumes that the distances involved are small relative to the size of the Earth or errors will occur due to the ellipsoidal nature of the globe. Units are in the currently used system length units.- Specified by:
convertPointsToLatLng
in interfaceIOwlMapUtils
- Parameters:
originLatLng
- The LatLng designating the originpts
- paths of points relative to the originLatLng- Returns:
- An IPaths of ILatLngs
-
getLatLngRelativeTo
Description copied from interface:IOwlMapUtils
Get the ILatLng that is the vector distance from the given origin ILatLng Assumes that the distances involved are small relative to the size of the Earth or errors will occur due to the ellipsoidal nature of the globe.- Specified by:
getLatLngRelativeTo
in interfaceIOwlMapUtils
- Parameters:
originLatLng
- The origin coordinatept
- A vector from the origin in feet- Returns:
- an ILatLng corresponding to the point relative to the origin.
-
getEarthMeanRadius
public double getEarthMeanRadius()Description copied from interface:IOwlMapUtils
Get the mean Earth radius in the units currently used by the system.- Specified by:
getEarthMeanRadius
in interfaceIOwlMapUtils
- Returns:
- The mean Earth radius in the system's current length measurement units.
-
getEarthEquatorialRadius
public double getEarthEquatorialRadius()Description copied from interface:IOwlMapUtils
Get the Earth's radius at the equator in the units currently used by the system.- Specified by:
getEarthEquatorialRadius
in interfaceIOwlMapUtils
- Returns:
- The equatorial radius of the Earth
-
getEarthPolarRadius
public double getEarthPolarRadius()Description copied from interface:IOwlMapUtils
Get the Earth's radius at the poles in the units currently used by the system.- Specified by:
getEarthPolarRadius
in interfaceIOwlMapUtils
- Returns:
- The polar radius of the Earth
-
getEarthRadius
public double getEarthRadius(double lat)Description copied from interface:IOwlMapUtils
Get the Earth's radius at the given latitude. The Earth's radius depends on latitude because it is an ellipsoid. The units are in the currently used system units.- Specified by:
getEarthRadius
in interfaceIOwlMapUtils
- Parameters:
lat
- The latitude to measure the radius- Returns:
- The Earth's radius at the given latitude
-
getLatFactor
public double getLatFactor(double lat)Description copied from interface:IOwlMapUtils
Get the length per degree factor for length per degree in a fixed latitude line at the given latitude. The calculation accounts for the dependence of the Earth's radius on latitude. However, caution should be observed for calculations done near the poles as out-of-bounds longitude values could easily occur.- Specified by:
getLatFactor
in interfaceIOwlMapUtils
- Parameters:
lat
- The latitude to calculate the conversion factor at.- Returns:
- length per degree of longitude in the current units used by the system.
-
getLngFactor
public double getLngFactor(double lat)Description copied from interface:IOwlMapUtils
Get the small angle approximation for the length per degree of factor for distances along a fixed longitude line at the given latitude. The calculation assumes that the Earth is a sphere equal to the Earth's radius at the given latitude. This could generate errors if the distances are very large since the Earth is an ellipsoid.- Specified by:
getLngFactor
in interfaceIOwlMapUtils
- Parameters:
lat
- The latitude to calculate the conversion factor at.- Returns:
- length per degree of latitude in the current units used by the system.
-