|
World Ocean Simulation System (WOSS) library
|
Coordinates (lat, long) class definitions and functions library. More...
#include <coordinates-definitions.h>


Public Member Functions | |
| constexpr | Coord (double lat=COORD_NOT_SET_VALUE, double lon=COORD_NOT_SET_VALUE) |
| constexpr | Coord (const Coord ©)=default |
| constexpr | Coord (Coord &&tmp)=default |
| constexpr void | setLatitude (double lat) |
| constexpr void | setLongitude (double lon) |
| constexpr bool | isValid () const |
| constexpr double | getLatitude () const |
| constexpr double | getLongitude () const |
| constexpr int | getMarsdenSquare () const |
| constexpr int | getMarsdenOneDegreeSquare () const |
| constexpr MarsdenCoord | getMarsdenCoord () const |
| constexpr double | getInitialBearing (const Coord &destination) const |
| constexpr double | getFinalBearing (const Coord &destination) const |
| constexpr double | getGreatCircleDistance (const Coord &destination, double depth=0) const |
| constexpr Coord & | operator= (const Coord ©)=default |
| constexpr Coord & | operator= (Coord &&tmp)=default |
Static Public Member Functions | |
| static constexpr Coord | getCoordFromBearing (const Coord &start_coord, double bearing, double distance, double depth=0.0) |
| static constexpr Coord | getCoordAlongGreatCircle (const Coord &start_coord, const Coord &end_coord, double distance, double depth=0.0) |
| static constexpr Coord | getCoordFromUtmWgs84 (double easting, double northing, double utm_zone_number, UtmZoneChar utm_zone_char) |
Static Public Attributes | |
| static constexpr double | COORD_MIN_LATITUDE = -90.0 |
| Minimum valid Latitude. | |
| static constexpr double | COORD_MAX_LATITUDE = 90.0 |
| Maximum valid Latitude. | |
| static constexpr double | COORD_MIN_LONGITUDE = -180.0 |
| Minimum valid Longitude. | |
| static constexpr double | COORD_MAX_LONGITUDE = 180.0 |
| Maximum valid Longitude. | |
| static constexpr double | EARTH_RADIUS = 6371000.0 |
| Mean earth radius in meters. | |
| static constexpr double | EARTH_SEMIMAJOR_AXIS = 6378137.0 |
| Earth's semi-major axis in meters as defined by both GRS80 and WGS84. | |
| static constexpr double | EARTH_GRS80_POLAR_RADIUS = 6356752.3141 |
| Earth's semi-major axis in meters as defined by GRS80. | |
| static constexpr double | EARTH_WGS84_POLAR_RADIUS = 6356752.314245 |
| Earth's polar radius in meters as defined by WGS84. | |
| static constexpr double | EARTH_GRS80_ECCENTRICITY = 0.0818191910428158 |
| Earth's first eccentricity as defined by GRS80. | |
| static constexpr double | EARTH_WGS84_ECCENTRICITY = 0.0818191908426215 |
| Earth's first eccentricity as defined by WGS84. | |
Protected Member Functions | |
| constexpr void | updateMarsdenCoord () |
Static Protected Member Functions | |
| static constexpr bool | isValidUtmZoneChar (UtmZoneChar utm_zone_char) |
Protected Attributes | |
| double | latitude |
| double | longitude |
| int | marsden_square |
| int | marsden_one_degree |
Friends | |
| constexpr Coord | operator+ (const Coord &left, const Coord &right) |
| constexpr Coord | operator- (const Coord &left, const Coord &right) |
| constexpr Coord & | operator+= (Coord &left, const Coord &right) |
| constexpr Coord & | operator-= (Coord &left, const Coord &right) |
| constexpr bool | operator== (const Coord &left, const Coord &right) |
| constexpr bool | operator!= (const Coord &left, const Coord &right) |
| constexpr bool | operator> (const Coord &left, const Coord &right) |
| constexpr bool | operator< (const Coord &left, const Coord &right) |
| constexpr bool | operator>= (const Coord &left, const Coord &right) |
| constexpr bool | operator<= (const Coord &left, const Coord &right) |
| std::ostream & | operator<< (std::ostream &os, const Coord &instance) |
Coordinates (lat, long) class definitions and functions library.
Coord class stores a double decimal degree latitude and double decimal degree longitude. It has a reach library for Marsden coordinates, distance, bearing and arithmetic calculations.
|
inlineconstexpr |
Coord constructor.
| lat | decimal degree latitude value. Default value makes the instance not valid |
| lon | decimal degree longitude value. Default value makes the instance not valid |
References updateMarsdenCoord().

|
constexprdefault |
|
constexprdefault |
|
inlinestaticconstexpr |
Gets destination Cood given bearing and distance from a start Coord, travelling along a (shortest distance) great circle arc of given depth to end Coord
| start_coord | valid start Coord instance |
| end_coord | valid end Coord instance |
| distance | distance measured in meters |
| depth | depth measured in meters |
References getCoordFromBearing(), and getInitialBearing().
Referenced by woss::CoordZ::getCoordZAlongGreatCircle().

|
inlinestaticconstexpr |
Gets destination Cood given bearing and distance from a start Coord, travelling along a (shortest distance) great circle arc of given depth
| start_coord | valid start Coord instance |
| bearing | bearing measured in radians |
| distance | distance measured in meters |
| depth | depth measured in meters |
References EARTH_RADIUS, isValid(), latitude, and longitude.
Referenced by WossCoordDefTest::doRun(), getCoordAlongGreatCircle(), and woss::ACToolboxWoss::initCoordZVector().

|
inlinestaticconstexpr |
Gets destination Cood given easting and northing in UTM - WGS84 coordinates
| easting | valid easting relative to central UTM zone meridian |
| end_coord | valid northing |
| utm_zone_number | validzone number |
| utm_zone_char | validzone character |
References EARTH_SEMIMAJOR_AXIS, EARTH_WGS84_POLAR_RADIUS, isValidUtmZoneChar(), latitude, and longitude.

|
inlineconstexpr |
Gets the final bearing of a trajectory
| destination | destination Coord instance |
References getInitialBearing().

|
inlineconstexpr |
Gets calculates great-circle distances between the two points – that is, the shortest distance over the earth’s surface – using the ‘Haversine’ formula
| destination | valid destination Coord instance |
References EARTH_RADIUS, isValid(), latitude, and longitude.
Referenced by WossChannelModule::computeCoordZPairVect(), WossCoordDefTest::doBearingTests(), woss::CoordZ::getCoordZAlongGreatCircle(), woss::WossManager::getWossPressure(), woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), woss::WossManager::getWossTimeArr(), woss::ACToolboxWoss::initAltimetry(), woss::Woss::initialize(), woss::WossDbManager::RangeOperator::operator()(), and WossWpPosition::updateVerticalOrientation().

|
inlineconstexpr |
Gets the initial bearing of a trajectory
| destination | destination Coord instance |
References isValid(), latitude, and longitude.
Referenced by WossCoordDefTest::doBearingTests(), getCoordAlongGreatCircle(), getFinalBearing(), woss::Woss::initialize(), woss::WossDbManager::BearingOperator::operator()(), and WossWpPosition::updateBearing().

|
inlineconstexpr |
Gets the latitude value
References latitude.
Referenced by woss::BellhopWoss::checkDepthOffsets(), woss::BellhopWoss::checkRangeOffsets(), woss::BathyGebcoDb::get1DBathyIndex(), woss::BathyGebcoDb::get2DBathyIndexes(), woss::SSP::getDepthfromPressure(), woss::Location::getLatitude(), woss::SSP::getPressureFromDepth(), WossChannelModule::getPropDelay(), woss::SedimDeck41CoordDb::getSeaFloorType(), woss::SedimDeck41CoordDb::getSedimIndex(), woss::SedimDeck41CoordDb::getSedimIndexes(), woss::SspWoa2005Db::getSSPIndexes(), woss::UtmWgs84::getUtmWgs84FromCoord(), woss::BathyGebcoDb::getValue(), woss::SSP::isAntarcticOcean(), woss::SSP::isArcticOcean(), woss::SSP::isBalticSea(), woss::SSP::isBlackSea(), woss::SSP::isCanonOcean(), woss::SSP::isCelebesSea(), woss::SSP::isHalmaheraSea(), woss::SSP::isJapanSea(), woss::SSP::isMediterraneanSea(), woss::SSP::isNEAtlanticOcean(), woss::SSP::isRedSea(), woss::SSP::isSuluSea(), WossPosition::WossPosition(), and woss::BellhopWoss::writeHeader().
|
inlineconstexpr |
Gets the longitude value
References longitude.
Referenced by woss::BellhopWoss::checkDepthOffsets(), woss::BellhopWoss::checkRangeOffsets(), woss::BathyGebcoDb::get1DBathyIndex(), woss::BathyGebcoDb::get2DBathyIndexes(), woss::Location::getLongitude(), WossChannelModule::getPropDelay(), woss::SedimDeck41CoordDb::getSeaFloorType(), woss::SedimDeck41CoordDb::getSedimIndex(), woss::SedimDeck41CoordDb::getSedimIndexes(), woss::SspWoa2005Db::getSSPIndexes(), woss::UtmWgs84::getUtmWgs84FromCoord(), woss::BathyGebcoDb::getValue(), woss::SSP::isBalticSea(), woss::SSP::isBlackSea(), woss::SSP::isCelebesSea(), woss::SSP::isHalmaheraSea(), woss::SSP::isJapanSea(), woss::SSP::isMediterraneanSea(), woss::SSP::isNEAtlanticOcean(), woss::SSP::isRedSea(), woss::SSP::isSuluSea(), WossPosition::WossPosition(), and woss::BellhopWoss::writeHeader().
|
inlineconstexpr |
Gets the marsden coordinates
References marsden_one_degree, and marsden_square.
|
inlineconstexpr |
Gets the marsden one degree square value
References marsden_one_degree.
|
inlineconstexpr |
Gets the marsden square value
References marsden_square.
|
inlineconstexpr |
Checks the validity of coordinates provided
References COORD_MAX_LATITUDE, COORD_MAX_LONGITUDE, COORD_MIN_LATITUDE, COORD_MIN_LONGITUDE, latitude, and longitude.
Referenced by getCoordFromBearing(), getGreatCircleDistance(), getInitialBearing(), woss::SSP::insertValue(), woss::SSP::insertValue(), woss::CoordZ::isValid(), woss::SSP::transform(), and updateMarsdenCoord().
|
inlinestaticconstexprprotected |
Checks if the passed utm zone character is valid
| utm_zone_char | utm zone character |
Referenced by getCoordFromUtmWgs84().
|
inlineconstexpr |
Sets latitude and updates marsden coordinates
| lat | latitude value |
References latitude, and updateMarsdenCoord().
Referenced by woss::Location::setLatitude().

|
inlineconstexpr |
Sets longitude and updates marsden coordinates
| lon | longitude value |
References longitude, and updateMarsdenCoord().
Referenced by woss::Location::setLongitude().

|
inlineconstexprprotected |
Calculates marsden coordinates from latitude and longitude
References isValid(), latitude, longitude, marsden_one_degree, and marsden_square.
Referenced by Coord(), setLatitude(), and setLongitude().

Inequality operator
| left | left operand const reference |
| right | right operand const reference |
Sum operator
| left | left operand const reference |
| right | right operand const reference |
Compound assignment sum operator
| left | left operand reference |
| right | right operand const reference |
Subtraction operator
| left | left operand const reference |
| right | right operand const reference |
Compound assignment subtraction operator
| left | left operand reference |
| right | right operand const reference |
Less than operator
| left | left operand const reference |
| right | right operand const reference |
|
friend |
<< operator
| os | left operand ostream reference |
| instance | right operand const Coord reference |
Less than or equal to operator
| left | left operand const reference |
| right | right operand const reference |
Equality operator
| left | left operand const reference |
| right | right operand const reference |
Greater than operator
| left | left operand const reference |
| right | right operand const reference |
Greater than or equal to operator
| left | left operand const reference |
| right | right operand const reference |
|
staticconstexpr |
Maximum valid Latitude.
Referenced by woss::SedimDeck41CoordDb::getSedimIndexes(), and isValid().
|
staticconstexpr |
Maximum valid Longitude.
Referenced by woss::SedimDeck41CoordDb::getSedimIndexes(), and isValid().
|
staticconstexpr |
Minimum valid Latitude.
Referenced by woss::SedimDeck41CoordDb::getSedimIndexes(), and isValid().
|
staticconstexpr |
Minimum valid Longitude.
Referenced by woss::SedimDeck41CoordDb::getSedimIndexes(), and isValid().
|
staticconstexpr |
Earth's first eccentricity as defined by GRS80.
Referenced by woss::CoordZ::getCartCoords().
|
staticconstexpr |
Earth's semi-major axis in meters as defined by GRS80.
Referenced by woss::CoordZ::getCoordZFromCartesianCoords().
|
staticconstexpr |
Mean earth radius in meters.
Referenced by woss::CoordZ::getCartCoords(), getCoordFromBearing(), woss::CoordZ::getCoordZAlongCartLine(), woss::CoordZ::getCoordZFromCartesianCoords(), woss::CoordZ::getCoordZFromSphericalCoords(), getGreatCircleDistance(), and woss::CoordZ::getSphericalRho().
|
staticconstexpr |
Earth's semi-major axis in meters as defined by both GRS80 and WGS84.
Referenced by woss::CoordZ::getCartCoords(), getCoordFromUtmWgs84(), woss::CoordZ::getCoordZFromCartesianCoords(), and woss::UtmWgs84::getUtmWgs84FromCoord().
|
staticconstexpr |
Earth's first eccentricity as defined by WGS84.
Referenced by woss::CoordZ::getCartCoords().
|
staticconstexpr |
Earth's polar radius in meters as defined by WGS84.
Referenced by getCoordFromUtmWgs84(), and woss::CoordZ::getCoordZFromCartesianCoords().
|
protected |
Latitude value
Referenced by woss::CoordZ::getCartCoords(), getCoordFromBearing(), getCoordFromUtmWgs84(), woss::CoordZ::getCoordZFromCartesianCoords(), getGreatCircleDistance(), getInitialBearing(), getLatitude(), woss::CoordZ::getSphericalTheta(), isValid(), setLatitude(), and updateMarsdenCoord().
|
protected |
Longitude value
Referenced by woss::CoordZ::getCartCoords(), getCoordFromBearing(), getCoordFromUtmWgs84(), woss::CoordZ::getCoordZFromCartesianCoords(), getGreatCircleDistance(), getInitialBearing(), getLongitude(), woss::CoordZ::getSphericalPhi(), isValid(), setLongitude(), and updateMarsdenCoord().
|
protected |
Marsden one degree square value
Referenced by getMarsdenCoord(), getMarsdenOneDegreeSquare(), and updateMarsdenCoord().
|
protected |
Marsden square value
Referenced by getMarsdenCoord(), getMarsdenSquare(), and updateMarsdenCoord().