GeoLocation

Search for usage in LXR

GeoLocation Class Reference

#include <geolocation.h>

Public Member Functions

 GeoLocation (const dms &lng, const dms &lat, const QString &name="Nowhere", const QString &province="Nowhere", const QString &country="Nowhere", double TZ=0, TimeZoneRule *TZrule=nullptr, double elevation=-10, bool readOnly=false, int iEllips=4)
 
 GeoLocation (double x, double y, double z, const QString &name="Nowhere", const QString &province="Nowhere", const QString &country="Nowhere", double TZ=0, TimeZoneRule *TZrule=nullptr, double elevation=-10, bool readOnly=false, int iEllips=4)
 
void cartToGeod ()
 
void changeEllipsoid (int i)
 
QString country () const
 
double distanceTo (const dms &longitude, const dms &latitude)
 
double elevation () const
 
int ellipsoid () const
 
QString fullName () const
 
void geodToCart ()
 
dms GSTtoLST (const dms &gst) const
 
bool isReadOnly () const
 
const CachingDmslat () const
 
double LMST (double jd)
 
const CachingDmslng () const
 
dms LSTtoGST (const dms &lst) const
 
KStarsDateTime LTtoUT (const KStarsDateTime &lt) const
 
QString name () const
 
QString province () const
 
void setCountry (const QString &n)
 
void setElevation (double hg)
 
void setEllipsoid (int i)
 
void setLat (const dms &l)
 
void setLong (const dms &l)
 
void setName (const QString &n)
 
void setProvince (const QString &n)
 
void setReadOnly (bool value)
 
void setTZ0 (double value)
 
void setTZRule (TimeZoneRule *value)
 
void setXPos (double x)
 
void setYPos (double y)
 
void setZPos (double z)
 
void TopocentricVelocity (double vtopo[], const dms &gt)
 
QString translatedCountry () const
 
QString translatedName () const
 
QString translatedProvince () const
 
double TZ () const
 
double TZ0 () const
 
TimeZoneRuletzrule ()
 
KStarsDateTime UTtoLT (const KStarsDateTime &ut) const
 
double xPos () const
 
double yPos () const
 
double zPos () const
 

Detailed Description

Contains all relevant information for specifying a location on Earth: City Name, State/Province name, Country Name, Longitude, Latitude, Elevation, Time Zone, and Daylight Savings Time rule.

Relevant data about an observing location on Earth.

Author
Jason Harris
Version
1.0

Definition at line 27 of file geolocation.h.

Constructor & Destructor Documentation

◆ GeoLocation() [1/2]

GeoLocation::GeoLocation ( const dms & lng,
const dms & lat,
const QString & name = "Nowhere",
const QString & province = "Nowhere",
const QString & country = "Nowhere",
double TZ = 0,
TimeZoneRule * TZrule = nullptr,
double elevation = -10,
bool readOnly = false,
int iEllips = 4 )

Constructor using dms objects to specify longitude and latitude.

Parameters
lngthe longitude
latthe latitude
namethe name of the city/town/location
provincethe name of the province/US state
countrythe name of the country
TZthe base time zone offset from Greenwich, UK
TZrulepointer to the daylight savings time rule
elevationthe elevation above sea level (in meters)
readOnlywhether the location is read only or updatable.
iEllipstype of geodetic ellipsoid model

Definition at line 12 of file geolocation.cpp.

◆ GeoLocation() [2/2]

GeoLocation::GeoLocation ( double x,
double y,
double z,
const QString & name = "Nowhere",
const QString & province = "Nowhere",
const QString & country = "Nowhere",
double TZ = 0,
TimeZoneRule * TZrule = nullptr,
double elevation = -10,
bool readOnly = false,
int iEllips = 4 )

Constructor using doubles to specify X, Y and Z referred to the center of the Earth.

Parameters
xthe x-position, in m
ythe y-position, in m
zthe z-position, in m
namethe name of the city/town/location
provincethe name of the province/US state
countrythe name of the country
TZthe base time zone offset from Greenwich, UK
TZrulepointer to the daylight savings time rule
elevationthe elevation above sea level (in meters)
readOnlywhether the location is read only or updatable.
iEllipstype of geodetic ellipsoid model

Definition at line 28 of file geolocation.cpp.

Member Function Documentation

◆ cartToGeod()

void GeoLocation::cartToGeod ( )

Converts from cartesian coordinates in meters to longitude, latitude and height on a standard geoid for the Earth.

The geoid is characterized by two parameters: the semimajor axis and the flattening.

Note
The astronomical zenith is defined as the perpendicular to the real geoid. The geodetic zenith is the perpendicular to the standard geoid. Both zeniths differ due to local gravitational anomalies.

Algorithm is from "GPS Satellite Surveying", A. Leick, page 184.

Definition at line 102 of file geolocation.cpp.

◆ changeEllipsoid()

void GeoLocation::changeEllipsoid ( int i)

Update Latitude, Longitude and Height according to new ellipsoid.

These are computed from XYZ which do NOT change on changing the ellipsoid.

Parameters
iindex to identify the ellipsoid

Definition at line 70 of file geolocation.cpp.

◆ country()

QString GeoLocation::country ( ) const
inline
Returns
untranslated Country name

Definition at line 124 of file geolocation.h.

◆ distanceTo()

double GeoLocation::distanceTo ( const dms & longitude,
const dms & latitude )

distanceTo Return the distance in km from this location to the given longitude and latitude

Parameters
longitudeTarget site longitude
latitudeTarget site latitude
Returns
distance in kilometers between this site and the target site.

Definition at line 213 of file geolocation.cpp.

◆ elevation()

double GeoLocation::elevation ( ) const
inline
Returns
elevation above seal level (meters)

Definition at line 76 of file geolocation.h.

◆ ellipsoid()

int GeoLocation::ellipsoid ( ) const
inline
Returns
index identifying the geodetic ellipsoid model

Definition at line 100 of file geolocation.h.

◆ fullName()

QString GeoLocation::fullName ( ) const
Returns
comma-separated city, province, country names (each localized)

Definition at line 46 of file geolocation.cpp.

◆ geodToCart()

void GeoLocation::geodToCart ( )

Converts from longitude, latitude and height on a standard geoid of the Earth to cartesian coordinates in meters.

The geoid is characterized by two parameters: the semimajor axis and the flattening.

Note
The astronomical zenith is defined as the perpendicular to the real geoid. The geodetic zenith is the perpendicular to the standard geoid. Both zeniths differ due to local gravitational anomalies.

Algorithm is from "GPS Satellite Surveying", A. Leick, page 184.

Definition at line 132 of file geolocation.cpp.

◆ GSTtoLST()

dms GeoLocation::GSTtoLST ( const dms & gst) const
inline

Definition at line 296 of file geolocation.h.

◆ isReadOnly()

bool GeoLocation::isReadOnly ( ) const

Definition at line 183 of file geolocation.cpp.

◆ lat()

const CachingDms * GeoLocation::lat ( ) const
inline
Returns
pointer to the latitude dms object

Definition at line 70 of file geolocation.h.

◆ LMST()

double GeoLocation::LMST ( double jd)
Returns
Local Mean Sidereal Time.
Parameters
jdJulian date

Definition at line 166 of file geolocation.cpp.

◆ lng()

const CachingDms * GeoLocation::lng ( ) const
inline
Returns
pointer to the longitude dms object

Definition at line 64 of file geolocation.h.

◆ LSTtoGST()

dms GeoLocation::LSTtoGST ( const dms & lst) const
inline

Definition at line 300 of file geolocation.h.

◆ LTtoUT()

KStarsDateTime GeoLocation::LTtoUT ( const KStarsDateTime & lt) const

Definition at line 203 of file geolocation.cpp.

◆ name()

QString GeoLocation::name ( ) const
inline
Returns
untranslated City name

Definition at line 106 of file geolocation.h.

◆ province()

QString GeoLocation::province ( ) const
inline
Returns
untranslated Province name

Definition at line 115 of file geolocation.h.

◆ setCountry()

void GeoLocation::setCountry ( const QString & n)
inline

Set Country name according to argument.

Parameters
nnew country name

Definition at line 245 of file geolocation.h.

◆ setElevation()

void GeoLocation::setElevation ( double hg)
inline

Set elevation above sea level.

Parameters
hgthe new elevation (meters)

Definition at line 189 of file geolocation.h.

◆ setEllipsoid()

void GeoLocation::setEllipsoid ( int i)

The geoid is an elliposid which fits the shape of the Earth.

It is characterized by two parameters: the semimajor axis and the flattening.

Parameters
iis the index which allows to identify the parameters for the chosen elliposid. 1="IAU76", 2="GRS80", 3="MERIT83", 4="WGS84", 5="IERS89".

Definition at line 60 of file geolocation.cpp.

◆ setLat()

void GeoLocation::setLat ( const dms & l)
inline

Set latitude according to dms argument.

Parameters
lthe new latitude

Definition at line 180 of file geolocation.h.

◆ setLong()

void GeoLocation::setLong ( const dms & l)
inline

Set longitude according to dms argument.

Parameters
lthe new longitude

Definition at line 171 of file geolocation.h.

◆ setName()

void GeoLocation::setName ( const QString & n)
inline

Set City name according to argument.

Parameters
nnew city name

Definition at line 229 of file geolocation.h.

◆ setProvince()

void GeoLocation::setProvince ( const QString & n)
inline

Set Province name according to argument.

Parameters
nnew province name

Definition at line 237 of file geolocation.h.

◆ setReadOnly()

void GeoLocation::setReadOnly ( bool value)

Definition at line 188 of file geolocation.cpp.

◆ setTZ0()

void GeoLocation::setTZ0 ( double value)
inline

Set Time zone.

Parameters
valuethe new time zone

Definition at line 157 of file geolocation.h.

◆ setTZRule()

void GeoLocation::setTZRule ( TimeZoneRule * value)
inline

Set Time zone rule.

Parameters
valuepointer to the new time zone rule

Definition at line 164 of file geolocation.h.

◆ setXPos()

void GeoLocation::setXPos ( double x)
inline

Set X.

Parameters
xthe new x-position (meters)

Definition at line 198 of file geolocation.h.

◆ setYPos()

void GeoLocation::setYPos ( double y)
inline

Set Y.

Parameters
ythe new y-position (meters)

Definition at line 206 of file geolocation.h.

◆ setZPos()

void GeoLocation::setZPos ( double z)
inline

Set Z.

Parameters
zthe new z-position (meters)

Definition at line 214 of file geolocation.h.

◆ TopocentricVelocity()

void GeoLocation::TopocentricVelocity ( double vtopo[],
const dms & gt )

Computes the velocity in km/s of an observer on the surface of the Earth referred to a system whose origin is the center of the Earth.

The X and Y axis are contained in the equator and the X axis is towards the nodes line. The Z axis is along the poles.

Parameters
vtopo[]Topocentric velocity. The resultant velocity is available in this array.
gtGreenwich sideral time for which we want to compute the topocentric velocity.

Definition at line 148 of file geolocation.cpp.

◆ translatedCountry()

QString GeoLocation::translatedCountry ( ) const
Returns
translated Country name

Definition at line 97 of file geolocation.cpp.

◆ translatedName()

QString GeoLocation::translatedName ( ) const
Returns
translated City name

Definition at line 76 of file geolocation.cpp.

◆ translatedProvince()

QString GeoLocation::translatedProvince ( ) const
Returns
translated Province name

Definition at line 90 of file geolocation.cpp.

◆ TZ()

double GeoLocation::TZ ( ) const
inline
Returns
time zone, including any DST correction.

Definition at line 142 of file geolocation.h.

◆ TZ0()

double GeoLocation::TZ0 ( ) const
inline
Returns
time zone without DST correction

Definition at line 136 of file geolocation.h.

◆ tzrule()

TimeZoneRule * GeoLocation::tzrule ( )
inline
Returns
pointer to time zone rule object

Definition at line 150 of file geolocation.h.

◆ UTtoLT()

KStarsDateTime GeoLocation::UTtoLT ( const KStarsDateTime & ut) const

Definition at line 193 of file geolocation.cpp.

◆ xPos()

double GeoLocation::xPos ( ) const
inline
Returns
X position in m

Definition at line 82 of file geolocation.h.

◆ yPos()

double GeoLocation::yPos ( ) const
inline
Returns
Y position in m

Definition at line 88 of file geolocation.h.

◆ zPos()

double GeoLocation::zPos ( ) const
inline
Returns
Z position in m

Definition at line 94 of file geolocation.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:09:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.