如何为Android模拟器控制准备KML文件?
我正在尝试使用位置信息测试我的应用程序。 您知道模拟器控件能够从 KML 文件加载。 (Eclipse -> DDMS -> 模拟器控制 -> 位置控制 -> KML -> 加载 KML...) 我已经使用 Google Earth 应用程序及其“添加路径”准备了 KML 文件。然后以.kml扩展名保存并加载到Eclipse上。 Eclipse 未加载此 KML 文件。
如何为Android模拟器控制准备KML文件?
I am trying to test my application with location information.
You know the Emulator Control has an ability to load from KML file. (Eclipse -> DDMS -> Emulator Control -> Location Controls -> KML -> Load KML...)
I've prepared KML file using Google earth application with its "Add path". Then saved it by .kml extension and load it on the Eclipse. Eclipse didn't load this KML file.
How to prepare KML file for Android Emulator Control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我找到了解决方案:
KML 格式为:
I've found solution :
KML format is :
ADT (0.8.x) 接受的 KML 格式与 Google Earth(甚至 Google Tracks)格式不同。
在 http://ge2adt.appspot.com/ 转换原始 KML 文件,使用您的 Google 帐户登录。
您现在可以尝试在模拟器控件中打开该文件。我仍然无法在模拟器中打开 KML 文件。打开 KML 文件并删除“文档”元素,不要删除“地标”元素。另请检查是否存在多个 KML 定义(“kml”元素)。我有两个只有一个地标的定义,以及一个带有多个地标的正确定义。删除仅包含一个地标的定义。
The KML format that's accepted by ADT (0.8.x) differs from the Google Earth (or even Google Tracks) format.
Convert the original KML file at http://ge2adt.appspot.com/, use your Google account to login.
You can now try to open the file in the emulator control. I still couldn't open the KML file in the emulator. Open the KML file and remove the 'Document' element, don't delete the 'Placemark' elements. Also check if there multiple KML definitions ('kml' element). I had two definitions with only one placemark, and one correct definition with multiple placemarks. Delete the definitions with only one placemark.
刚刚对此进行了测试,发现实际上要让 ADT 接受您的 KML 文件,您唯一需要更改的就是将命名空间更改为 http://earth.google.com/kml/2.x。
你可能认为谷歌的某个人现在已经解决了这个问题......
Just tested this, and found actually the only thing you need to change to get the ADT to accept your KML file is to change the namespace to http://earth.google.com/kml/2.x.
You'd think someone at Google would have sorted this out by now...
KML 文件必须是 3D 文件 - 某些 GIS 工具(例如 QGIS)不会将 Z 值放入如果输入数据中不存在,则输出。通过简单的搜索并替换为在每个结束
标记之前添加 ,0 即可解决此问题。
The KML file must be a 3D file - some GIS tools (e.g. QGIS) don't put the Z value in the output if it is not present in your input data. A simple search and replace to add ,0 before each closing
</coordinate>
tag will solve this problem.