在具有高数据分辨率的R编程中计算大圆弧距离 [英] Calculating great circle distance in r programming with high data resolution

查看:128
本文介绍了在具有高数据分辨率的R编程中计算大圆弧距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是R编程的新手,但我正在计算长途客机飞行的大圆距,因此我尝试了使用Fields包中的rdist.earth()sp包中的soDistsN1()和其他命令.另外,我在搜索中几乎已经用尽了Google.在Matlab中这样做很容易,但是我似乎在R中找不到方法.

I'm new to R programming but I'm calculating the great circle distance flown by a long haul airliner and I've tried rdist.earth() from the Fields package, soDistsN1() from the sp package and other commands. Plus I've pretty much exhausted Google in my search. It's easy to do this in Matlab but I can't seem to find a way in R.

问题是当我提高数据分辨率(计算出的航点数量)时,我的总距离变得一团糟.我猜是因为我总结了航路点之间的总距离.有任何想法吗?

The problem is when I increase the data resolution (amount of waypoints calculated) my total distance goes haywire. I'm guessing it is because of how I summarize the total distance between waypoints. Any ideas?

我尝试过的示例:

data <- read.csv("FDM_test_Flight.csv")
library(fields)
fix <- cbind(data$LON, data$LAT)
fix_2 <- window(fix, deltat=500) # every 500th position I have 25,540 position readings                      
gcd <- rdist.earth(fix_2, miles=FALSE, R=6371)
sum(gcd)

推荐答案

您可以使用

由于r以Km为单位,因此您的大圆距离将为Km.

Since r is given in Km your great circle distances will be Km.

这篇关于在具有高数据分辨率的R编程中计算大圆弧距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆