如何转换为Google编码的折线算法格式? [英] How to convert to Google encoded polyline algorithm format?

查看:289
本文介绍了如何转换为Google编码的折线算法格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google地图的编码多段线格式会将lat / lon信息以及缩放级别。

我有一个巨大的带有经度/纬度对的文本文件,我想要将它转换为这种格式和不同部分的折线(即我需要执行批量转换)



有谁知道执行此操作的代码?

解决方案

编码和解码多义线的权威性参考由Mark McClure教授在 http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/

它包含了实用程序,讨论了在Perl,Ruby,PHP,Java和Mathematica中使用Javascript代码的算法和端口。注意:对于第3版,您不需要版本2所需的级别字符串。版本3为自己计算出级别。


The encoded polyline format for Google maps stores lat/lon information as well as zoom levels.

I have a huge text file with lat/lon pairs that i want to convert to this format and for different sections of polylines (i.e. i need to perform a batch conversion)

Does anyone know of a code that performs this operation ?

解决方案

The definitive reference to encoding and decoding polylines is by Professor Mark McClure, at http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/

It contains utilities, a discussion of the algorithm and ports of the Javascript code into Perl, Ruby, PHP, Java and Mathematica.

Note: for Version 3, you don't need the levels string which is needed for Version 2. Version 3 works out the levels for itself.

这篇关于如何转换为Google编码的折线算法格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆