将轨迹对应到google earth(谷歌地球)上

本文提供了一个将机器人轨迹映射到Google Earth上的方法,通过创建KML文件并替换经纬度数据,然后在Google Earth中打开以查看轨迹。同时分享了两个用于经纬度和XY坐标转换的代码文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  下面为将机器人的轨迹对应到谷歌地球上的demo,只需要将 <coordinates> 与 </coordinates>之间的经纬度坐标换成自己的经纬度坐标数据,然后将下面的内容保存的到文件中,将扩展名改为.kml,再打开google earth,将该文件拖进去,即可在上面显示对应的坐标轨迹。(有个小问题,如果大家要把下面的内容copy然后尝试一下用google earth加载,记得copy到文件之后把后面的作者,来源,版权,声明的那个去掉(⊙o⊙))

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<kml xmlns="http://earth.google.com/kml/2.2">
  <Document>
    <name>X-GPS Explorer</name>
    <Style id="X-GPSExplorer">
      <IconStyle>
        <Icon>
          <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
        </Icon>
        <hotSpot x="32" y="1" xunits="pixels" yunits="pixels" />
      </IconStyle>
    </Style>
    <Folder>
      <name>Place Mark</name>
    </Folder>
    <Placemark>
      <name>My Path</name>
      <Style>
        <LineStyle>
          <color>ff0000ff</color>
          <width>2</width>
      </LineStyle>
      </Style>
      <LineString>
        <coordinates>

114.3550997,30.53966355
114.3551003,30.53966349
114.3551008,30.53966342
114.3551014,30.53966335
114.3551019,30.53966328
114.3551025,30.53966317
114.3551031,30.53966305
114.3551037,30.53966294
114.3551043,30.53966283
114.3551049,30.53966272
114.3551055,30.5396626
114.3551061,30.53966249
114.3551067,30.53966237
114.3551073,30.53966225
114.3551079,30.53966215
114.3551085,30.53966202
114.3551091,30.53966189
114.3551096,30.53966176
114.3551102,30.53966165
114.3551107,30.53966154
114.3551113,30.53966145
114.3551119,30.53966137
114.3551124,30.53966129
114.355113,30.53966123
114.3551136,30.53966116
114.3551143,30.53966103
114.355115,30.53966089
114.3551157,30.53966076
114.3551164,30.53966063
114.355117,30.5396605
114.3551177,30.53966037
114.3551184,30.53966025
114.3551191,30
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值