Interface IOwlMapUtils

All Known Implementing Classes:
AOwlMapUtils

public interface IOwlMapUtils
Utilities for working with an IOwlMap map, including information about the Earth and working with latitude/longitude values and relative distances.
Author:
swong
  • 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.
    MapLengthUnits getSystemLengthUnit()
    Get the currently set system length unit
  • Method Details

    • getSystemLengthUnit

      MapLengthUnits getSystemLengthUnit()
      Get the currently set system length unit
      Returns:
      the current length unit
    • getLngFactor

      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. 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.
      Parameters:
      lat - The latitude to calculate the conversion factor at.
      Returns:
      length per degree of latitude in the current units used by the system.
    • getLatFactor

      double getLatFactor​(double lat)
      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.
      Parameters:
      lat - The latitude to calculate the conversion factor at.
      Returns:
      length per degree of longitude in the current units used by the system.
    • getEarthMeanRadius

      double getEarthMeanRadius()
      Get the mean Earth radius in the units currently used by the system.
      Returns:
      The mean Earth radius in the system's current length measurement units.
    • getEarthEquatorialRadius

      double getEarthEquatorialRadius()
      Get the Earth's radius at the equator in the units currently used by the system.
      Returns:
      The equatorial radius of the Earth
    • getEarthPolarRadius

      double getEarthPolarRadius()
      Get the Earth's radius at the poles in the units currently used by the system.
      Returns:
      The polar radius of the Earth
    • convertPointsToLatLng

      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. 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.
      Parameters:
      originLatLng - The ILatLng designating the origin
      pts - path of points relative to the originLatLng
      Returns:
      An IPath of ILatLngs
    • convertPointsToLatLng

      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. 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.
      Parameters:
      originLatLng - The LatLng designating the origin
      pts - paths of points relative to the originLatLng
      Returns:
      An IPaths of ILatLngs
    • getLatLngRelativeTo

      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.
      Parameters:
      originLatLng - The origin coordinate
      pt - A vector from the origin in feet
      Returns:
      an ILatLng corresponding to the point relative to the origin.
    • getEarthRadius

      double getEarthRadius​(double lat)
      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.
      Parameters:
      lat - The latitude to measure the radius
      Returns:
      The Earth's radius at the given latitude