下面为将机器人的轨迹对应到谷歌地球上的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.53966013
114.3551198,30.53966002
114.3551205,30.5396599
114.3551211,30.53965986
114.3551217,30.53965985
114.3551224,30.53965983
114.355123,30.53965981
114.3551236,30.53965978
114.3551242,30.53965974
114.3551248,30.53965971
114.3551255,30.53965965
114.3551261,30.53965959
114.3551267,30.53965952
114.3551273,30.5396595
114.3551278,30.53965947
114.3551284,30.53965944
114.3551289,30.53965941
114.3551294,30.53965938
114.35513,30.53965935</coordinates></LineString></Placemark></Document>
</kml>

  再分享个将经纬度坐标与xy坐标相互转换的两个头文件,我忘记在哪儿找到的了,现贴在下面,免得自已有需要的时候又找不到了,就酱。然后下面两个代码我挂到llandxy.zip上面去卖积分了,大佬们如果觉得这两个代码对你很有帮助,而你的积分又有很多的话,帮忙去那里面下,赏我两个积分^_^。
“convert_coordinates.hpp”

// Author:         Andreas Geiger <geiger@kit.edu>#if !defined(CONVERT_COORDINATES_HPP)
#define CONVERT_COORDINATES_HPP
#define M_PI 3.141593
#include <cmath>/*!* \file convert_coordinates.hpp** \brief provides functions to convert global lat/long into local cartesian x/y coordinates** the following functions map lat/long coordinates to the euclidean mercator coordinate system mx/my* lat/long are always specified in degrees (DEG)* mx is the distance from the central meridian towards EAST* my is the distance from the equator towards NORTH* mercator cordinates mx/my correspond to metric coordinates x/y ONLY at the equator (scale=1)* at other latitudes a scale factor can be used to get metric relations* for more details see GCDC/docs/coordinate_systems.pdf* \note that in GCDC x is towards NORTH, y towards WEST!!!*/namespace convert_coordinates {const double EARTH_RADIUS_EQUA = 6378137.0;// earth radius at equator [m]// inlined functions to avoid multiple definitions/*! \brief convert latitude to scale, which is needed by mercator transformations*  \param lat latitude in degrees (DEG)*  \return scale factor*  \note when converting from lat/lon -> mercator and back again,*        or vice versa, use the same scale in both transformations!*/inline double lat_to_scale (double lat) {return cos(lat * M_PI / 180.0);}/*! \brief converts lat/lon/scale to mx/my (mx/my in meters if correct scale is given)*/template<class float_type>inline void latlon_to_mercator (double lat, double lon, double scale, float_type &mx, float_type &my) {mx = scale * lon * M_PI * EARTH_RADIUS_EQUA / 180.0;my = scale * EARTH_RADIUS_EQUA * log( tan((90.0+lat) * M_PI / 360.0) );}/*! \brief convenience function, uses lat0 to calculate appropriate scale*/inline void latlon_to_scaled_mercator (double lat, double lon, double lat0, double &mx, double &my) {double scale = lat_to_scale( lat0 );mx = scale * lon * M_PI * EARTH_RADIUS_EQUA / 180.0;my = scale * EARTH_RADIUS_EQUA * log( tan((90.0+lat) * M_PI / 360.0) );}/*! \brief converts mx/my/scale to lat/lon (mx/my in meters if correct scale is given)*/inline void mercator_to_latlon (double mx, double my, double scale, double &lat, double &lon) {lon = mx * 180.0 / (M_PI * EARTH_RADIUS_EQUA * scale);lat = 360.0 * atan( exp(my/(EARTH_RADIUS_EQUA * scale)) ) / M_PI - 90.0;}/*! \brief convenience function, uses lat0 to calculate appropriate scale*/inline void scaled_mercator_to_latlon (double mx, double my, double lat0, double &lat, double &lon) {double scale = lat_to_scale( lat0 );lon = mx * 180.0 / (M_PI * EARTH_RADIUS_EQUA * scale);lat = 360.0 * atan( exp(my/(EARTH_RADIUS_EQUA * scale)) ) / M_PI - 90.0;}/*! \brief adds meters dx/dy to given lat/lon and returns new lat/lon*/inline void latlon_add_meters (double lat_start, double lon_start, double dx, double dy, double &lat_end, double &lon_end) {double scale = lat_to_scale (lat_start);double mx,my;latlon_to_mercator (lat_start, lon_start, scale, mx, my);mx += dx;my += dy;mercator_to_latlon (mx, my, scale, lat_end, lon_end);}/*! \brief given two lat/lon coordinates, returns their difference in meters dx/dy*/inline void latlon_diff_to_meters (double lat_start, double lon_start, double lat_end, double lon_end, double &dx, double &dy) {double scale = lat_to_scale (lat_start);double mx1,my1, mx2, my2;latlon_to_mercator (lat_start, lon_start, scale, mx1, my1);latlon_to_mercator (lat_end, lon_end, scale, mx2, my2);dx = mx2-mx1;dy = my2-my1;}};#endif

“LocalGeographicCS.hpp”

// File:           LocalGeographicCS.hpp
// Creation Date:  Tuesday, March  6 2012
// Author:         Julius Ziegler <ziegler@mrt.uka.de>#if !defined(LOCALGEOGRAPHICCS_HPP)
#define LOCALGEOGRAPHICCS_HPP#include "convert_coordinates.hpp"#include <utility>struct LocalGeographicCS
{LocalGeographicCS();LocalGeographicCS( double lat0, double lon0 );void set_origin( double lat0, double lon0 );void ll2xy( double lat, double lon, double& x, double& y ) const;void xy2ll( double x, double y, double& lat, double& lon ) const; std::pair<double, double> ll2xy( double lat, double lon ) const;std::pair<double, double> xy2ll( double x, double y ) const;// operate on containerstemplate<class ItIn, class ItOut>void ll2xy( const ItIn& lat_begin, const ItIn& lat_end, const ItIn& lon_begin, const ItOut& x_begin, const ItOut& y_begin ) const;template<class ItIn, class ItOut>void xy2ll( const ItIn& x_begin, const ItIn& x_end, const ItIn& y_begin, const ItOut& lat_begin, const ItOut& lon_begin ) const;//get coordsdouble get_coordx();double get_coordy();private:double _scale;double _x0, _y0;
};inline double LocalGeographicCS::get_coordx()
{return _x0;
}inline double LocalGeographicCS::get_coordy()
{return _y0;
}inline LocalGeographicCS::LocalGeographicCS( double lat0, double lon0 )
{set_origin( lat0, lon0 );
}inline LocalGeographicCS::LocalGeographicCS()
{}inline void LocalGeographicCS::set_origin( double lat0, double lon0 )
{_scale = convert_coordinates::lat_to_scale( lat0 );convert_coordinates::latlon_to_mercator( lat0, lon0, _scale, _x0, _y0 );
}inline void LocalGeographicCS::ll2xy( double lat, double lon, double& x, double& y ) const
{convert_coordinates::latlon_to_mercator( lat, lon, _scale, x, y );// printf("&&&&&&&&&&&& %.6f %.6f\n", _x0, _y0);x -= _x0;y -= _y0;
}inline std::pair<double, double> LocalGeographicCS::ll2xy( double lat, double lon ) const
{double x, y;ll2xy( lat, lon, x, y );return std::make_pair( x, y );
}inline void LocalGeographicCS::xy2ll( double x, double y, double& lat, double& lon ) const
{x += _x0;y += _y0;convert_coordinates::mercator_to_latlon( x, y, _scale, lat, lon );
}inline std::pair<double, double> LocalGeographicCS::xy2ll( double x, double y ) const
{double lat, lon;xy2ll( x, y, lat, lon );return std::make_pair( lat, lon );
}// operate on containers
template<class ItIn, class ItOut>
void LocalGeographicCS::ll2xy( const ItIn& lat_begin, const ItIn& lat_end, const ItIn& lon_begin, const ItOut& x_begin, const ItOut& y_begin ) const
{ItIn lat = lat_begin;ItIn lon = lon_begin;ItOut x = x_begin;ItOut y = y_begin;for( ; lat != lat_end; lat++, lon++, x++, y++ ){ll2xy( *lat, *lon, *x, *y );}
}template<class ItIn, class ItOut>
void LocalGeographicCS::xy2ll( const ItIn& x_begin, const ItIn& x_end, const ItIn& y_begin, const ItOut& lat_begin, const ItOut& lon_begin ) const
{ItIn x = x_begin;ItIn y = y_begin;ItOut lat = lat_begin;ItOut lon = lon_begin;for( ; x != x_end; lat++, lon++, x++, y++ )xy2ll( *x, *y, *lat, *lon );
}#endif

将轨迹对应到google earth(谷歌地球)上相关推荐

  1. Google Earth谷歌地球卫片下载器--可下载全球历史卫星,无偏移、高精度

    Google Earth谷歌地球卫片下载器--可下载全球历史卫星,无偏移.高精度 Google Earth谷歌地球卫片下载器 (build662)升级正式发布,水经注万能地图下载器升级正式发布,水经注 ...

  2. Google Earth谷歌地球卫片下载器

    Google Earth谷歌地球卫片下载器--可下载全球历史卫星,无偏移.高精度 Google Earth谷歌地球卫片下载器 (build662)升级正式发布,水经注万能地图下载器升级正式发布,水经注 ...

  3. mapinfo图层导入奥维_(通信技能分享)怎样把谷歌地球上画的路线图导入到测试软件中!...

    对于我们外场的工作人员来说,路线图很重要,但是有些我们没有去过现场,测试过程中又不好看手机看地图,今天我们就来学习一下如何通过谷歌地图画线路图,然后做成tab图层导入测试软件里面去. 1.我们需要先画 ...

  4. 如何在谷歌地球上画路线或者运动轨迹?根据纬经高信息在谷歌地球Google earth中画运动轨迹,首先将Excel文件纬经高信息转换为.csv文件,再转换为.kml文件,最终在谷歌地球中显示。

    (制作运动轨迹的前提是装有谷歌地球和CSV2kml转换工具, CSV2kml转换工具的下载可在下列链接中下载https://download.csdn.net/download/howe1233/10 ...

  5. 根据经纬度信息画实际地图中的轨迹之百度地图与谷歌地球

    优缺点分析: 百度地图:方便快捷,实时使用,不需要下载软件,网页实现:但是不够精确,用高精度GPS算下的经纬度画出来的图与真实偏差大(看图,轨迹都不在路上...). 谷歌地图:精度高,比较适合高精度G ...

  6. 如何将INS惯导经、纬、高数据在谷歌地球上绘制轨迹

    1.将功能包中发布的ins_data数据输出到文本中 rostopic echo -p /Inertial_Labs/ins_data>gpsData 2.将gpsData文件数据导入excel ...

  7. 如何在谷歌地球上绘制路线

    打开谷歌地球,点击"添加",选择"路径",这时会弹出路线属性框.在属性框里定义路线名称.线条颜色和宽度等.定义后,把属性框移到一边,不要关闭.点击起点,然后按住 ...

  8. 谷歌地球(Google Earth) 7.3.3.7721

    谷歌地球(Google Earth) 是由Google公司开发的地图软件.谷歌地球采用了谷歌公司的卫星技术,覆盖全球任何一个角落,让你坐在家中就能将整个地球尽收眼底.感兴趣的朋友快来下载吧 . 谷歌地 ...

  9. Win之Software Installation:谷歌地球(Google Earth) 的简介、安装、使用方法之详细攻略

    Win之Software Installation:谷歌地球(Google Earth) 的简介.安装.使用方法之详细攻略 目录 谷歌地球(Google Earth) 的简介 谷歌地球(Google ...

最新文章

  1. full calendar mysql_fullcalendar 及mysql数据库的工作日管理
  2. 使用Scala-IDE构建Maven项目
  3. (0012) iOS 开发之MAC 终端命令学习
  4. keygen基本流程
  5. cherrypy 入门笔记(1) hello world
  6. .net EF监控 MiniProfiler
  7. (poj)1064 Cable master 二分+精度
  8. python中二进制表示_Python中的二进制搜索:直观介绍
  9. python shell的交互模式和文本编辑模式
  10. Android 微信分享信息
  11. 关于举办2008年注册电气工程师执业资格考试供配电专业(基础)
  12. NET 常见网络命令
  13. AJRW错误AA707
  14. xul eclipse插件_将HTML元素添加到XUL插件
  15. html5文本框获取焦点,CSS3实现文本输入框获取焦点高亮显示
  16. APP - 支付宝怎么延时转账?能否撤回转账?
  17. bootstrap进度条媒体对象和Well组件
  18. linux shell 最后一行,Bash:抓住第二行和输出的最后一行(ls -lrS)只有
  19. C++ Qt高仿QQ影音视频播放器 (二)
  20. pytorch CUDNN_STATUS_MAPPING_ERROR

热门文章

  1. WIN10专业版/家庭版激活
  2. 在Twig模板中获取 request参数
  3. Y7000黑苹果安装后系统优化和使用指南
  4. 企业办公新模式,随时随地云上协同!
  5. 随身wifi骁龙410刷debian系统带宝塔5.x版
  6. WifiUtils wifi工具类
  7. 一种软件升级程序updata的 构造思路
  8. 查询所有学生的课程及分数情况
  9. 【Code pratice】—— 纸牌三角形
  10. access当前窗体模糊查询