40#ifndef WOSS_COORDINATES_DEFINITIONS_H
41#define WOSS_COORDINATES_DEFINITIONS_H
97 #define COORD_NOT_SET_VALUE (-2000)
141 Coord(
double lat = COORD_NOT_SET_VALUE,
double lon = COORD_NOT_SET_VALUE );
450 double getX()
const {
return x; }
496 CoordZ(
double lat = COORD_NOT_SET_VALUE,
double lon = COORD_NOT_SET_VALUE,
double z = COORD_NOT_SET_VALUE );
768 UtmWgs84(
int utmZone = COORD_NOT_SET_VALUE,
double east = COORD_NOT_SET_VALUE,
double north = COORD_NOT_SET_VALUE);
775 double getEasting()
const;
777 double getNorthing()
const;
779 bool isValid()
const;
814 template <
class CompUser,
class T = Coord >
833 if ( CompUser::getSpaceSampling() <= 0.0 )
return operator<(x,y);
834 if ( x.getGreatCircleDistance(y) <= CompUser::getSpaceSampling() )
return false;
848 template <
class CompUser >
866 if ( CompUser::getSpaceSampling() <= 0.0 )
return operator<(x,y);
867 if ( x.
getCartDistance(y) <= CompUser::getSpaceSampling() )
return false;
875 Coord& operator+=( Coord& left,
const Coord& right );
877 Coord& operator-=( Coord& left,
const Coord& right );
879 CoordZ& operator+=( CoordZ& left,
const CoordZ& right );
881 CoordZ& operator-=( CoordZ& left,
const CoordZ& right );
899 if ( &left == &right )
return true;
905 if ( &left == &right )
return false;
911 if ( &left == &right )
return false;
917 if ( &left == &right )
return false;
923 if ( left == right )
return true;
924 return( left > right );
929 if ( left == right )
return true;
930 return( left < right );
934 inline ::std::ostream&
operator<<(::std::ostream& os,
const Coord& x) {
942 inline ::std::ostream& operator<<( ::std::ostream& os,
const CoordZ::CartCoords& instance ) {
943 os <<
"X = " << instance.x <<
"; Y = " << instance.y <<
"; Z = " << instance.z <<
"; type = " << instance.type;
949 if ( &left == &right )
return true;
955 if ( &left == &right )
return false;
961 if ( &left == &right )
return false;
969 if ( &left == &right )
return false;
976 if ( left == right )
return true;
977 return( left > right );
982 if ( left == right )
return true;
983 return( left < right );
987 inline ::std::ostream&
operator<<( ::std::ostream& os,
const CoordZ& instance ) {
988 os <<
"Latitude = " << instance.
latitude <<
"; Longitude = " << instance.
longitude <<
"; Depth = " << instance.
depth
1006 inline int UtmWgs84::getZone()
const {
1010 inline double UtmWgs84::getEasting()
const {
1014 inline double UtmWgs84::getNorthing()
const {
1018 inline bool UtmWgs84::isValid()
const {
1019 return ((zone != COORD_NOT_SET_VALUE) && (
easting != COORD_NOT_SET_VALUE) && (
northing != COORD_NOT_SET_VALUE));
1022 inline ::std::ostream&
operator<<( ::std::ostream& os,
const UtmWgs84& instance ) {
1023 os <<
"Zone = " << instance.zone <<
"; Easting = " << instance.easting <<
"; Northing = " << instance.northing;
bool operator!=(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:846
std::ostream & operator<<(std::ostream &os, const Altimetry &instance)
Definition altimetry-definitions.h:826
bool operator==(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:840
const Altimetry operator+(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:257
const Altimetry operator-(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:264
bool operator()(const CoordZ &x, const CoordZ &y) const
Definition coordinates-definitions.h:862
Function object for partial ordering of coordinates.
Definition coordinates-definitions.h:815
bool operator()(const T &x, const T &y) const
Definition coordinates-definitions.h:829
Class that represents cartesian coordinates.
Definition coordinates-definitions.h:429
double getY() const
Definition coordinates-definitions.h:456
CartCoords()
Definition coordinates-definitions.cpp:364
double getZ() const
Definition coordinates-definitions.h:462
friend::std::ostream & operator<<(::std::ostream &os, const CartCoords &instance)
double z
Y-asis value in meters.
Definition coordinates-definitions.h:484
CoordZSpheroidType type
Z-asis value in meters.
Definition coordinates-definitions.h:486
CoordZSpheroidType getType() const
Definition coordinates-definitions.h:468
double getX() const
Definition coordinates-definitions.h:450
double y
X-asis value in meters.
Definition coordinates-definitions.h:482
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:403
friend::std::ostream & operator<<(::std::ostream &os, const CoordZ &instance)
double getCartRelZenith(const CoordZ &coords) const
Definition coordinates-definitions.cpp:464
double getSphericalRho() const
Definition coordinates-definitions.cpp:427
static const CoordZ getCoordZAlongCartLine(const CoordZ &start, const CoordZ &end, double distance)
Definition coordinates-definitions.cpp:493
friend bool operator==(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:948
friend bool operator<(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:968
friend const CoordZ operator-(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1001
double getSphericalTheta() const
Definition coordinates-definitions.cpp:432
friend CoordZ & operator-=(CoordZ &left, const CoordZ &right)
double getCartY(CoordZSpheroidType type=COORDZ_SPHERE) const
Definition coordinates-definitions.cpp:417
static const double COORDZ_MIN_DEPTH
Minimum valid depth.
Definition coordinates-definitions.h:408
friend bool operator>(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:960
double getCartX(CoordZSpheroidType type=COORDZ_SPHERE) const
Definition coordinates-definitions.cpp:412
double getCartDistance(const CoordZ &coords, CoordZSpheroidType type=COORDZ_SPHERE) const
Definition coordinates-definitions.cpp:442
CartCoords getCartCoords(CoordZSpheroidType type=COORDZ_SPHERE) const
Definition coordinates-definitions.cpp:382
friend bool operator!=(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:954
double getSphericalPhi() const
Definition coordinates-definitions.cpp:437
static const CoordZ getCoordZFromCartesianCoords(double x, double y, double z, CoordZSpheroidType type=COORDZ_SPHERE)
Definition coordinates-definitions.cpp:580
double getCartRelAzimuth(const CoordZ &coords) const
Definition coordinates-definitions.cpp:454
CoordZSpheroidType
Spheroid model to use.
Definition coordinates-definitions.h:418
friend bool operator>=(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:975
CoordZ & operator=(const CoordZ &coordz)
Definition coordinates-definitions.cpp:538
friend const CoordZ operator+(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:995
double getCartZ(CoordZSpheroidType type=COORDZ_SPHERE) const
Definition coordinates-definitions.cpp:422
friend CoordZ & operator+=(CoordZ &left, const CoordZ &right)
void setDepth(double d)
Definition coordinates-definitions.h:518
static const CoordZ getCoordZAlongGreatCircle(const CoordZ &start, const CoordZ &end, double distance)
Definition coordinates-definitions.cpp:474
virtual bool isValid() const
Definition coordinates-definitions.h:645
friend bool operator<=(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:981
double depth
Definition coordinates-definitions.h:755
static const CoordZ getCoordZFromSphericalCoords(double rho, double theta, double phi)
Definition coordinates-definitions.cpp:663
double getDepth() const
Definition coordinates-definitions.h:525
Coordinates (lat, long) class definitions and functions library.
Definition coordinates-definitions.h:107
void setLongitude(double lon)
Definition coordinates-definitions.h:161
int getMarsdenOneDegreeSquare() const
Definition coordinates-definitions.h:193
void setLatitude(double lat)
Definition coordinates-definitions.h:155
static const Coord getCoordFromBearing(const Coord &start_coord, double bearing, double distance, double depth=0.0)
Definition coordinates-definitions.cpp:189
Coord & operator=(const Coord ©)
Definition coordinates-definitions.cpp:306
friend const Coord operator+(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:886
static const double COORD_MIN_LATITUDE
Minimum valid Latitude.
Definition coordinates-definitions.h:111
static const double COORD_MAX_LONGITUDE
Maximum valid Longitude.
Definition coordinates-definitions.h:117
static const Coord getCoordAlongGreatCircle(const Coord &start_coord, const Coord &end_coord, double distance, double depth=0.0)
Definition coordinates-definitions.cpp:301
double getLatitude() const
Definition coordinates-definitions.h:175
friend const Coord operator-(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:892
double getInitialBearing(const Coord &destination) const
Definition coordinates-definitions.cpp:143
friend Coord & operator+=(Coord &left, const Coord &right)
friend bool operator!=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:904
static bool isValidUtmZoneChar(UtmZoneChar utm_zone_char)
Definition coordinates-definitions.cpp:210
double getGreatCircleDistance(const Coord &destination, double depth=0) const
Definition coordinates-definitions.cpp:171
friend bool operator>=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:922
int getMarsdenSquare() const
Definition coordinates-definitions.h:187
double getLongitude() const
Definition coordinates-definitions.h:181
double latitude
Definition coordinates-definitions.h:364
MarsdenCoord getMarsdenCoord() const
Definition coordinates-definitions.h:199
static const double EARTH_WGS84_POLAR_RADIUS
Earth's polar radius in meters as defined by WGS84.
Definition coordinates-definitions.h:128
static const Coord getCoordFromUtmWgs84(double easting, double northing, double utm_zone_number, UtmZoneChar utm_zone_char)
Definition coordinates-definitions.cpp:222
friend::std::ostream & operator<<(::std::ostream &os, const Coord &instance)
static const double EARTH_GRS80_ECCENTRICITY
Earth's first eccentricity as defined by GRS80.
Definition coordinates-definitions.h:131
static const double EARTH_SEMIMAJOR_AXIS
Earth's semi-major axis in meters as defined by both GRS80 and WGS84.
Definition coordinates-definitions.h:122
virtual bool isValid() const
Definition coordinates-definitions.h:168
friend bool operator<(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:916
double longitude
Definition coordinates-definitions.h:369
friend Coord & operator-=(Coord &left, const Coord &right)
double getFinalBearing(const Coord &destination) const
Definition coordinates-definitions.cpp:161
friend bool operator<=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:928
static const double COORD_MIN_LONGITUDE
Minimum valid Longitude.
Definition coordinates-definitions.h:115
int marsden_one_degree
Definition coordinates-definitions.h:380
friend bool operator==(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:898
int marsden_square
Definition coordinates-definitions.h:375
void updateMarsdenCoord()
Definition coordinates-definitions.cpp:89
static const double EARTH_WGS84_ECCENTRICITY
Earth's first eccentricity as defined by WGS84.
Definition coordinates-definitions.h:134
static const double EARTH_RADIUS
Mean earth radius in meters.
Definition coordinates-definitions.h:119
static const double EARTH_GRS80_POLAR_RADIUS
Earth's semi-major axis in meters as defined by GRS80.
Definition coordinates-definitions.h:125
friend bool operator>(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:910
static const double COORD_MAX_LATITUDE
Maximum valid Latitude.
Definition coordinates-definitions.h:113
Definition coordinates-definitions.h:758
friend::std::ostream & operator<<(::std::ostream &os, const UtmWgs84 &instance)
double northing
Definition coordinates-definitions.h:802
static const UtmWgs84 getUtmWgs84FromCoord(const Coord &coords)
Definition coordinates-definitions.cpp:679
double easting
Definition coordinates-definitions.h:801
::std::vector< Marsden > MarsdenVector
Definition coordinates-definitions.h:86
bool operator<=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:928
::std::pair< int, int > MarsdenCoord
Definition coordinates-definitions.h:76
::std::vector< CoordZ > CoordZVector
Definition coordinates-definitions.h:64
::std::vector< MarsdenCoord > MarsdenCoordVector
Definition coordinates-definitions.h:91
bool operator>=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:922
char UtmZoneChar
Definition coordinates-definitions.h:58
bool operator<(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:916
int Marsden
Definition coordinates-definitions.h:69
bool operator>(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:910
::std::vector< Coord > CoordVector
Definition coordinates-definitions.h:81