位置计算 - 是否适用UTM? [英] Location calculation- is UTM appropiate?

查看:132
本文介绍了位置计算 - 是否适用UTM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据点AB和C的位置计算点D的位置,我知道A点相对于D和D相对于B的角度,C相对于D.



实际上,AB和C点是我用GPS标记的3个位置,D点是我尝试获取GPS位置的无线电动物的位置。通过了解无线电领带动物相对于北方的哪个方向而获得的角度。

我已经编写了算法,但我知道我不能将GPS坐标直接放入其中,并且必须将它们转换并重新转换。我一直在使用谷歌搜索,我有点困惑,使用笛卡尔或UTM更适合这个吗?



如何将GPS转换为UTM ?我搜查了一下,我有点困惑。有些转换说的是度分和秒,我的GPS似乎给了我一个额外的数字,所以它的N 68.21.446和`W 12.14.284



相关的,我认为这个区域在我的计算中是2D,使事情变得更简单。



感谢您的帮助。
以下是代码,但我不确定它是否需要:

 #10/09/2013 
#输入你的分数AB和C
#AN和AW是你的第一个GPS分数AA是角度
AN <-10
AW <-0
AA < - 45
#BN和BW是你的第二个
BN <-10
BW <-0
BA <-0
#CN和CW是你的第三个
CN <-0
CW <-10
CA <-90

#将这些转​​换为?



#工作出距离
#对于每个坐标和角度,需要计算y = mx + c来创建一条线
#从这3行开始,你可以计算出它们相交的地方

#如果角度是0,它就不会工作,所以使它非常接近0.
if(AA == 0){ AA <-0.00001}
if(BA == 0){BA <-0.00001}
if(CA == 0){CA <-0.00001}

#全部转换角度到弧度
AAr < - (AA * pi)/ 180
BAr < - (BA * pi)/ 180
CAr <-( CA * pi)/ 180
$ (b)
AM< -1 / tan(AAr)
BM< -1 / tan(BAr)
CM< -1 / tan (CAr)

#Calculate C方程常数
#c = ym * x
AC <-AW-AM * AN
BC <-BW-BM * (AC-BC)/(BM-AM)b
$ CC $< -CW-CM * CN

#交叉口交叉口
#A和B
XAB<
YAB < - (AM * XAB + AC)

#B和C
XBC < - (BC-CC)/(CM-BM)
YBC < - (BM * XBC + BC)

#C和
XAC < - (CC-AC)/(AM-CM)
YAC < - (CM * XAC + CC)

#完成这些的平均值3分b $ b(XofABC < - (XAB + XBC + XAC)/(3))
(YofABC < - (YAB + YBC + YAC)/(3))


#将此转换回GPS坐标

`

解决方案

使用 rgdal spTransform 函数完成坐标系转换c $ c>包。您需要将坐标转换为十进制度数,然后才能将其转换为UTM坐标系。



那么,十进制度中的N 68.21.446是什么?那么我不确定。它的68 +(21/60),但你需要找出最后一个数字是什么。它可能是a)千分之一分钟(如果它的第一个数字是6或更多,那么看起来很可能)或b)秒数然后十分之一秒。

对于a)N 68.21.446然后是68 +(21/60)+(446/1000)/ 60十进制度。



对于b )N 68.21.446然后是68 +(21/60)+(44/3600)+(6/36000)十进制度数。



你必须使用一些字符串匹配功能来分割它。



一旦你有了使用这些数字创建空间点数据框,将CRS设置为您的GPS坐标系(可能是EPSG代码4326),然后使用 spTransform 转换为您的UTM代码 - 除非它的北极熊或帝企鹅和距离不是几十公里,那么UTM坐标应该是一个很好的近似于一个常规的方格。更大的错误来源将是你的角度测量!

关于这个问题,我确实开始编写一个R包,用于从无线电测向设备进行定位,文献中的一些统计方法。您会在这里找到: https://github.com/barryrowlingson/telemetr



如果您对该软件包有任何意见,请通过该github网站向我发送,而不是在StackOverflow上。

I'm wanting to calculate the location of point D, based on the location of point A B and C where I know the angle of point A relative to D and D relative to B and c relative to D.

In real terms, points A B and C are 3 locations i have marked with my GPS and point D is the location of a radiocollared animal I'm attempting to get a GPS location on. The angles I gain by knowing in which direction the radio collared animal is relative to north.

I've written the algorithm, but I know I can't put GPS co-ordinates straight into it and will have to convert them in and then out again. I've been googling, and I'm a bit confused, is the usage of cartesian or UTM more appropriate for this?

How do I go about converting GPS to UTM? I've searched and I'm a bit confused. Some conversions talk of degrees minutes adn seconds, my GPS appears to give me an addiitonal number to this, so its N 68.21.446 and `w 12.14.284

Incase its relevant, I've assumed that the area is 2d in my calculations to make things a bit simpler.

Thank you for your help. Here is the code though I'm not sure its needed:

#10/09/2013
#Enter your points for locations A B and C 
#AN and AW is your first GPS points AA is the angle
AN<-10
AW<-0
AA<-45
#BN and BW are your second  
BN<-10
BW<-0
BA<-0
#CN and CW are your third
CN<-0
CW<-10
CA<-90

#Convert these to ?



#work out distance 
#For each co ordinate and angle, you need to calculate y=mx+c to make a line
#From these 3 lines, you can work out where they intersect

#If the angle is 0 it wont work, so make it very close to 0. 
if(AA==0) {AA<-0.00001}
if(BA==0) {BA<-0.00001}
if(CA==0) {CA<-0.00001}

#Convert all angles to radians
AAr<-(AA*pi)/180
BAr<-(BA*pi)/180
CAr<-(CA*pi)/180

#Calculate M which is 1/tan(b)
AM<-1/tan(AAr)
BM<-1/tan(BAr)
CM<-1/tan(CAr)

#Calculate C the equation constant
#c=y-m*x
AC<-AW-AM*AN
BC<-BW-BM*BN
CC<-CW-CM*CN

#Caclulate intersections
#A and B 
XAB<-(AC-BC)/(BM-AM)
YAB<-(AM*XAB+AC)

#B and C 
XBC<-(BC-CC)/(CM-BM)
YBC<-(BM*XBC+BC)

#C and A
XAC<-(CC-AC)/(AM-CM)
YAC<-(CM*XAC+CC)

#Work out average of these 3 points
(XofABC<-(XAB+XBC+XAC)/(3))
(YofABC<-(YAB+YBC+YAC)/(3))


#Convert this back into GPS coordinate

`

解决方案

Coordinate system transformations are done using the spTransform function in the rgdal package. You'll need to convert your coordinates to decimal degrees before you can convert them to UTM coords.

So, what is your "N 68.21.446" in decimal degrees? Well I'm not sure. Its 68 + (21/60) but you need to find out what the last number is. It might be a) thousandths of a minute (and if the first digit of it is ever 6 or more then that would seem likely) or b) two digits for seconds and then tenths of seconds.

For a) N 68.21.446 is then 68 + (21/60) + (446/1000)/60 decimal degrees.

For b) N 68.21.446 is then 68 + (21/60) + (44/3600) + (6/36000) decimal degrees.

You'll have to use some string matching functions to split it up.

Once you've got decimal degrees, create a spatial points dataframe with those numbers, set its CRS to your GPS coordinate system (probably EPSG code 4326) and then use spTransform to convert to your UTM code - use the one appropriate for your longitude.

Unless its polar bears or emperor penguins and the distances are not tens of km then the UTM coordinates should be a good approximation to a regular square grid. The bigger source of error is going to be your angular measurements!

On that subject, I did start writing an R package for doing location finding from radio direction finding equipment, implementing some of the statistical methods in the literature. You'll find that here: https://github.com/barryrowlingson/telemetr

If you have any comments on that package, address them to me via that github site, and not here on StackOverflow.

这篇关于位置计算 - 是否适用UTM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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