public List<Location> GetGeoPoints(string encoded)
{
List<Location> poly = new List<Location>();
int index = , len = encoded.Length;
int lat = , lng = ;
while (index < len)
{
int b, shift = , result = ;
do
{
b = encoded.ToCharArray()[index++] - ;
result |= (b & 0x1f) << shift;
shift += ;
} while (b >= 0x20);
int dlat = ((result & ) != ? ~(result >> ) : (result >> ));
lat += dlat; shift = ;
result = ;
do
{
b = encoded.ToCharArray()[index++] - ;
result |= (b & 0x1f) << shift;
shift += ;
} while (b >= 0x20);
int dlng = ((result & ) != ? ~(result >> ) : (result >> ));
lng += dlng; double latResult = ((double)lat / 1E5) * 1E6 * Math.Pow(, -);
double lngResult = ((double)lng / 1E5) * 1E6 * Math.Pow(, -);
Location p = new Location(latResult, lngResult);
poly.Add(p);
}
return poly;
}

最新文章

  1. SilverFoxServer出炉!!
  2. VS2010 项目引用了微软企业库,但是编译时提示:未能找到类型或命名空间名称
  3. java-语句
  4. Linux命令-tr
  5. 为Ubuntu配置ssh服务 方便远程登陆
  6. Java NIO中核心组成和IO区别
  7. Android 常用动画小结
  8. 外设:K9F2G08 nandflash 底层读写、控制驱动程序,可随机读写
  9. iis虚拟目录引发的路径问题
  10. table在 点击线条颜色
  11. linux下操作mysql
  12. SSH框架搭建最终版【测试、log4j、baseDao】
  13. jquery常用函数
  14. PIC单片机基础2
  15. wrapper induction随笔
  16. Pycharm 远程调试
  17. SQLSERVER查询数据库死锁的存储过程
  18. 冬瓜头答疑:磁盘阵列内部FC-AL的性能问题
  19. 认识Hadoop
  20. Python之输出当前时间

热门文章

  1. log:日志处理模块
  2. ORACLE SQL性能优化汇总
  3. WdatePicker日期控件使用与值获取,以及选择日期完毕触发事件
  4. Bert-util安装
  5. HDU 6735 结论网络流 机器人不重叠路径
  6. 一致性Hash算法(转载)
  7. Docker常用命令行
  8. Spring框架集成FreeMarker
  9. ajax向后台传递数组参数并将后台响应的数据赋值给一个变量供其它插件使用
  10. Java8-LongAccumulator