gtsam
3rdparty
GeographicLib
examples
examples/example-GeoCoords.cpp
Go to the documentation of this file.
1
// Example of using the GeographicLib::GeoCoords class
2
3
#include <iostream>
4
#include <exception>
5
#include <
GeographicLib/GeoCoords.hpp
>
6
7
using namespace
std
;
8
using namespace
GeographicLib
;
9
10
int
main
() {
11
try
{
12
// Miscellaneous conversions
13
double
lat
= 33.3,
lon
= 44.4;
14
GeoCoords
c
(
lat
,
lon
);
15
cout <<
c
.MGRSRepresentation(-3) <<
"\n"
;
16
c
.Reset(
"18TWN0050"
);
17
cout <<
c
.DMSRepresentation() <<
"\n"
;
18
cout <<
c
.Latitude() <<
" "
<<
c
.Longitude() <<
"\n"
;
19
c
.Reset(
"1d38'W 55d30'N"
);
20
cout <<
c
.GeoRepresentation() <<
"\n"
;
21
}
22
catch
(
const
exception&
e
) {
23
cerr <<
"Caught exception: "
<<
e
.what() <<
"\n"
;
24
return
1;
25
}
26
}
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition:
JacobiConformal.hpp:15
c
Scalar Scalar * c
Definition:
benchVecAdd.cpp:17
GeoCoords.hpp
Header for GeographicLib::GeoCoords class.
GeographicLib::GeoCoords
Conversion between geographic coordinates.
Definition:
GeoCoords.hpp:49
std
Definition:
BFloat16.h:88
lon
static const double lon
Definition:
testGeographicLib.cpp:34
main
int main()
Definition:
examples/example-GeoCoords.cpp:10
lat
static const double lat
Definition:
testGeographicLib.cpp:34
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:31