问题描述
Re,
我有一个400MB大小的KML文件 - 1周的旅程和5000公里的日志记录。它已经被剥夺了非必要的数据。 GPX文件大约80MB或2.5MB。 KML文件大约30MB。我不确定有多少路标,但必须有几十万路。
我会如何将其映射到Google地图上?有没有办法减少文件而不影响我的音轨质量?我使用jQuery和Google Maps API v2或v3。
谢谢。
在Google Maps API中使用KML文件非常简单。一个例子如下:
KmlLayer(http://myserver/kmlfile.kml)
请参阅。
但是,您的大型KML文件存在问题。未压缩KML文件的当前最大值为10MB ,比您的30MB小很多。请参阅。
根据我的经验,将大型KML文件添加到地图中也很慢。因此加载你的9MB文件需要很多时间。我建议你做的是减少文件的大小。
你真的需要所有这些成千上万的航点吗?什么是你的登录步骤?每10秒钟一次?你需要把你的位置放在仪表上,是不是每100米都足够?顺便说一句:你在做基于互联网的东西吗?我记得谷歌地球支持任意大型的KML文件(但肯定比地图API大)。
我不知道任何有轨迹的程序或航点卸妆,但确实有这样的事情,这就是你需要使KML文件变得更小(也是30MB仍然听起来对我来说非常大,你确定它只是航点,或者你有KML中的描述和类似内容吗?你可以缩短这些颜色吗?使用全局KML颜色,而不是为每个航点定义颜色!)
Re,
I have a KML file that's 400MB large - 1 week of travel and 5000km logged. It's already stripped of non-essential data. GPX file from that is around 80MB or 2.5MB zipped. KML file is around 30MB. I am not sure how many waypoints there are but must be hundreds of thousand.
How would I go about mapping it on Google Maps? Is there a way to reduce the file without compromising the quality of my tracks? I am using jQuery and Google Maps API v2 or v3.
Thanks.
Well it is very easy using a KML file with the Google Maps API. An example would be the following:
KmlLayer(http://myserver/kmlfile.kml)
See the API 3.0 Reference on the KmlLayer here.
But you have a problem with your large KML file. The current maximum for an uncompressed KML file is 10MB, a lot smaller than your 30MB. See the reference on KML support here.
In my experience adding large KML files to a map is also very slow. So loading your e.g. 9MB file will take lots of time. What I suggest you do is to reduce the size of the file.
Do you really need all those hundreds of thousands of waypoints? What was your logging stepping? Like each 10 seconds? Do you need to have your location down to the meter, isn't every 100meters enough? Btw: Are you working on an internet-based thing? I remember Google Earth supporting arbitrary large KML files (but certainly larger than the maps API).
I don't know any track-smothing programs or "waypoint remover", but there surely are such things out there and that is what you will need to make your KML file smaller (also 30MB still sounds very large to me, are you sure it is only waypoints or do you have decriptions and the like in the KML? Could you shorten these? Colors? Use global KML colors instead of defining the color for each waypoint!)
这篇关于在Google地图中映射400MB KML数据 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!