资源简介
参考https://blog.csdn.net/niu_88/article/details/97690318,

代码片段和文件信息
/*======================================================================*
* *
* map project *
* *
* Author: niu hongfang *
* Date: 2019.07.29 *
* Addr: Shen Zhen Guangdong *
* *
*=======================================================================*/
#include “map_project.h“
#include “math.h“
#define E_a 6378137.0f /* 地球纬度圈半径 m */
#define E_b 6356755.0f /* 地球经度圈半径 m */
/*
* note: coordinate ref init.
*
* @param1 ref
* @param2 latitude rad -pi/2~pi/2
* @param3 longitude rad -pi~pi
* @param4 h m
* @return init success/failure
*/
int coordinate_map_ref_init(coordinate_map_t *pref double lon double lat double h)
{
double e e_2;
double f;
double sin_2_lat;
double R_lat_circle;
double R_lon_circle;
double den_prime_vertical R_prime_vertical omiga_2;
if (lat > M_PI_F / 2 || lat < -M_PI_F / 2){
return -1;
}
f = (E_a - E_b) / E_a;
e_2 = f * (2.0 - f);
sin_2_lat = sin(lat);
omiga_2 = 1 - e_2 * sin_2_lat;
den_prime_vertical = sqrtf(omiga_2);
R_prime_vertical = E_a / den_prime_vertical;
R_lat_circle = (R_prime_vertical + h) * cosf(lat);
R_lon_circle = R_prime_vertical * (1 - e_2) / omiga_2 + h;
pref->h_lat = lat;
pref->h_lon = lon;
pref->dx_mue = R_lon_circle;
pref->dy_lambda = R_lat_circle;
pref->inited = 1;
return 0;
}
int coordinate_map_project(const coordinate_map_t *pref double lon double lat float *x float *y)
{
if (!pref->inited){
return -1;
}
*x = pref->dx_mue * lon;
*y = pref->dy_lambda * lat;
return 0;
}
int coordinate_map_reproject(const coordinate_map_t *pref float x float y double *lon double *lat)
{
if (!pref->inited){
return -1;
}
*lon = (double)x / pref->dx_mue;
*lat = (double)y / pref->dy_lambda;
return 0;
}
int coordinate_map_ref_distance(const coordinate_map_t *pref double lon double lat float *d_x float *d_y)
{
if (!pref->inited){
return -1;
}
double d_lon d_lat;
d_lon = lon - pref->h_lon;
d_lat = lat - pref->h_lat;
*d_x = d_lon*pref->dx_mue;
*d_y = d_lat*pref->dy_lambda;
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2243 2019-07-29 22:15 map_project.cpp
文件 708 2019-07-29 22:11 map_project.h
- 上一篇:基于DSP的设计正弦波信号发生器
- 下一篇:基于MIPS32位的ALU设计
相关资源
- 武汉大学 科傻GPS 静态后处理软件
- K码和经纬度转换excel表格
- 开源的nmealib
- 经纬度与大地坐标换算
- 相干与非相干实现捕获与跟踪GPS
- 天文钟GPS对时程序
- 球面坐标与平面坐标的转换
- 用切比雪夫多项式标准化GPS卫星轨道
- 起算点点位不同对GPS-RTK测高的影响
- GPS-RTK技术在公婆泉矿区详查中的应用
-
A web-ba
sed interview platform with geospat - 根据GPS数据计算航向公式
- Excel在GPS坐标转换计算中的应用
- 大学数据包含经纬度
- GPS-RTK技术及EPSW全息测绘软件在沉陷治
- 基于GPS数据的露天矿道路网自动提取
- 基于GPS-RTK与全站仪的城市道路改扩建
- GPS-RTK、全站仪联合作业在化石沟铜矿
- 基于GPS一机多天线技术的尾矿坝全自
- GPS技术在山区边坡监测中的应用
- GPS-RTK与全站仪联合作业在山谷型采石
- 论变形监测技术的现状与发展趋势
- GPS技术在大采深采区建筑物变形监测
- 探讨GPS技术在地形复杂矿山变形监测
- 全球地名地址及GPS坐标数据库
- 工作/生活照片归档管理/Exif查看器/
- gps程序、算法
- STM32+陀螺仪+GPS代码
- 基于单片机的GPS定位及显示系统设计
- 中国地图地理坐标经纬度数据
评论
共有 条评论