如何从shapefile / kml生成编码多段线? [英] How to generate encoded polylines from shapefile/ kml?

查看:184
本文介绍了如何从shapefile / kml生成编码多段线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将shapefile / kml转换为某个项目的编码折线格式。有人知道一个简单的转换工具或代码可以达到相同的效果吗? 您需要先将您的KML / SHP列入经纬度/长对列表。对于KML,您只需在编辑器中打开KML文件即可获得经纬度对。对于SHP,您可以先使用 shp2kml 转换为KML。 然后,使用 编码 库,或者您可以使用算法


I need to convert a shapefile/ kml to encoded polyline format for a certain project. Does anyone know of a simple conversion tool or code that achieves the same ?

解决方案

You'll first want to convert your KML/SHP to a list of lat/long pairs. For KML, you can simply open the KML file in an editor to get the lat/long pairs. For SHP, you can first use shp2kml to convert to KML.

Then, use the encoding library in the Maps API, or you can write your own encoder using the algorithm.

这篇关于如何从shapefile / kml生成编码多段线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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