如何为Android模拟器控制准备KML文件?

发布于 2024-08-18 20:07:05 字数 240 浏览 4 评论 0原文

我正在尝试使用位置信息测试我的应用程序。 您知道模拟器控件能够从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

北方的巷 2024-08-25 20:07:05

我找到了解决方案:
KML 格式为:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.x">
<Placemark>
    <name>1</name>
        <Point><coordinates>-109.0450005395891,33.39487928579279,0</coordinates></Point>
</Placemark>
</kml>

I've found solution :
KML format is :

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.x">
<Placemark>
    <name>1</name>
        <Point><coordinates>-109.0450005395891,33.39487928579279,0</coordinates></Point>
</Placemark>
</kml>
苦行僧 2024-08-25 20:07:05

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.

〆一缕阳光ご 2024-08-25 20:07:05

刚刚对此进行了测试,发现实际上要让 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...

倦话 2024-08-25 20:07:05

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文