OpendTect  6.3
latlong.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert
8  Date: 2008
9  Contents: Geographics lat/long <-> Coord transform (an estimate)
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "basicmod.h"
15 #include "coord.h"
16 
17 
23 {
24 public:
25  LatLong( double la=0, double lo=0 )
26  : lat_(la), lng_(lo) {}
27 
28  LatLong( const Coord& c ) { *this = transform(c);}
29  operator Coord() const { return transform(*this); }
30 
31  bool isDefined() const {return !mIsUdf(lat_)&&!mIsUdf(lng_);}
32  static LatLong udf() { return LatLong(mUdf(double),mUdf(double)); }
33 
34  static Coord transform(const LatLong&);
35  static LatLong transform(const Coord&);
36 
37  const char* toString() const;
38  bool fromString(const char*);
39 
40  void getDMS(bool lat,int&,int&,float&) const;
41  void setDMS(bool lat,int,int,float);
42 
43  double lat_;
44  double lng_;
45 };
#define mExpClass(module)
Definition: commondefs.h:157
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:285
bool isDefined() const
Definition: latlong.h:31
double lng_
Definition: latlong.h:44
Geographical coordinates, decimal but with conv to deg, min, sec.
Definition: latlong.h:22
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
BufferString toString(const DBKey &ky)
Definition: dbkey.h:115
static LatLong udf()
Definition: latlong.h:32
LatLong(const Coord &c)
Definition: latlong.h:28
double lat_
Definition: latlong.h:43
Coord2d Coord
Definition: commontypes.h:83
LatLong(double la=0, double lo=0)
Definition: latlong.h:25
2D point or vector class.
Definition: commontypes.h:58

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017