gpt4 book ai didi

c# - 将纬度/经度转换为 MGRS

转载 作者:可可西里 更新时间:2023-11-01 09:10:37 26 4
gpt4 key购买 nike

有谁知道我在哪里可以找到将纬度/经度位置转换为 Military Grid Reference System (MGRS) 的代码库?如果可能,我正在寻找 C# 实现。

最佳答案

我们最终使用了 GeoTrans并从代码创建 DLL 并使用 PInvoke 调用函数。我们从源代码中提取了以下内容,以防有人想知道(最小解决方案):

  • 极地
  • 转运
  • 向上
  • utm
  • 管理人员

我们使用的 PInvoke 签名:

[DllImport("mgrs.dll")]
public static extern int Convert_Geodetic_To_MGRS(
double Latitude,
double Longitude,
int Precision, // 1 to 5, we used 4 (10 square meters)
StringBuilder MGRS);

对应mgrs.h中的这个函数:

MGRSDLL_API long __stdcall Convert_Geodetic_To_MGRS(
double Latitude,
double Longitude,
long Precision,
char* MGRS);

关于c# - 将纬度/经度转换为 MGRS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3374537/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com