Class GeoLocation

A class that contains location information such as latitude and longitude required for astronomical calculations. The elevation field may not be used by some calculation engines and would be ignored if set.

© Eliyahu Hershfeld 2004 - 2016

1.1

Hierarchy (view full)

Constructors

  • GeoLocation constructor with parameters for all required fields.

    Parameters

    • name: null | string

      The location name for display use such as "Lakewood, NJ"

    • latitude: number

      the latitude in a double format such as 40.095965 for Lakewood, NJ. Note: For latitudes south of the equator, a negative value should be used.

    • longitude: number

      double the longitude in a double format such as -74.222130 for Lakewood, NJ. Note: For longitudes west of the Prime Meridian (Greenwich), a negative value should be used.

    • elevation: number

      the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating sunrise and set.

    • timeZoneId: string

      the TimeZone for the location.

    Returns GeoLocation

Methods

  • Method to get the elevation in Meters.

    Returns number

    Returns the elevation in Meters.

  • Returns number

    Returns the latitude.

  • Returns null | string

    Returns the location name.

  • Returns number

    Returns the longitude.

  • Returns string

    Returns the timeZone.

  • Method to set the elevation in Meters above sea level.

    Parameters

    • elevation: number

      The elevation to set in Meters. An Error will be thrown if the value is a negative.

    Returns void

  • Parameters

    • latitude: number

    Returns void

  • Parameters

    • name: null | string

      The setter method for the display name.

    Returns void

  • Parameters

    • longitude: number

    Returns void

  • Method to set the TimeZone.

    Parameters

    • timeZoneId: string

      The timeZone to set.

    Returns void