using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace test
{
public class CoordTrans
{
//
[DllImport("coord_trans.dll", EntryPoint = "convert", CallingConvention = CallingConvention.Cdecl)]
public static extern int convert(int from, int to, ref coord input, ref coord output);
}
public struct coord
{
/// <summary>维度</summary>
public double lat;
/// <summary>经度</summary>
public double lng;

/// <summary>坐标</summary>
/// <param name="lat">维度</param>
/// <param name="lng">经度</param>
public coord(double lat, double lng)
{
this.lat = lat;
this.lng = lng;
}
}

class Program
{
//取值为如下:
//1:GPS设备获取的角度坐标,wgs84坐标;
//3:google地图、soso地图、aliyun地图、mapabc地图和amap地图所用坐标,国测局坐标(GCJ02);
//5:百度地图采用的经纬度坐标(bd09ll);

static void Main(string[] args)
{
coord input = new coord(31.221816, 121.350051);
coord output = new coord(0.0, 0.0);
int result = CoordTrans.convert(1, 5, ref input, ref output);

if (result == 0)
Console.WriteLine("convert ok! lat[{0}], lng[{1}]", output.lat, output.lng);
else
Console.WriteLine("convert fail!");
}
}
}

最新文章

  1. 手机app测试之我见
  2. php采集远程文章简单类
  3. vim的基本使用方法
  4. phpcms v9升级后台无法上传缩略图的原因分析
  5. Spring连接MySQL、Oracle和SQL Server
  6. ABP官方文档翻译 6.5 内嵌资源文件
  7. yum的一些命令使用方法
  8. Linux 命令分类学习
  9. yii2 rules 验证规则
  10. Python 安装beautifulsoup4遇到No module named setuptools问题解决方法
  11. 蓝桥杯_算法训练_Torry的困惑(基本型)
  12. java kill thread command line
  13. 【托业】【新托业TOEIC新题型真题】学习笔记9-题库七+八--P4-5
  14. Linux使用退格键时出现^H解决方法
  15. Nginx 用log_format设置日志格式
  16. 【C#】简单计算器源代码
  17. Tensorflow從源碼編譯
  18. (转)为什么所有浏览器的user-agent都是Mozilla
  19. 优化Hibernate所鼓励的7大措施:
  20. Android热点回顾第六期

热门文章

  1. ES6判断对象是否为空
  2. Loading Methods
  3. js区分图片加载中和加载完成状态
  4. 每次 git 都需要输入用户名和密码的解决办法
  5. Flask + PyInstaller = 客户端
  6. Github好用的镜像网站
  7. python官方文档:https://pypi.org/
  8. web基础(5): CSS3介绍
  9. 错误提示“com.alibaba.fastjson.JSONException: exepct &#39;[&#39;, but string, pos 4, json”解决
  10. application.yaml