GeographicLib安装
发布日期:2021-05-14 09:33:24 浏览次数:20 分类:精选文章

本文共 1302 字,大约阅读时间需要 4 分钟。

������GeographicLib������������������������������������

���������������������������������������������������������������������

tar xzf GeographicLib-1.51.tar.gz

���������������������������������

cd GeographicLib-1.51

������������������������������������������������������������������

mkdir BUILD
cd BUILD

������������������cmake������������������������������������Linux���Unix���MacOSX���������������������������

cmake ..

������cmake���������������������������������������������������������

make
make test
sudo make install

���������������������GeographicLib���������������������������CMakeLists.txt���������������������

find_package(GeographicLib REQUIRED)
add_executable(program source1.cpp source2.cpp)
target_link_libraries(program ${GeographicLib_LIBRARIES})

������������

���������WGS84���UTM������MGRS������������������������������

#include 
#include
#include
double northing, easting;
bool northp;
int izone;
// WGS84���UTM
double lat, lon;
WGS84toUTM(lat, lon, izone, northp, easting, northing);
// UTM���MGRS
std::string mgrs;
MGRS::Forward(izone, northp, easting, northing, 7, mgrs);
// ���������MGRS������������
std::cout << mgrs.substr(5, 7).insert(5, ".") << "\n";

������������������������prec������_gpilo���_mgrs���������������������������������������

上一篇:Ubuntu18系统 PL2303GT驱动安装及绑定
下一篇:C++ 顺序容器学习笔记(二)

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2025年05月03日 17时59分50秒