如何转换为Google编码的折线算法格式? [英] How to convert to Google encoded polyline algorithm format?
问题描述
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屋!