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

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

问题描述

我要基于点A B和C的位置来计算点D的位置,在这里我知道点A相对于D的角度以及点D相对于B和c相对于D的角度.

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.

实际上,点A B和C是我用GPS标记的3个位置,点D是我要在其上获取GPS位置的放射性领动物的位置.通过了解无线电领动物相对于北方的哪个方向,我获得的角度.

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.

我已经编写了算法,但是我知道我无法将GPS坐标直接输入该算法,而必须先将其转换然后再转换出来.我一直在使用Google搜索,但有点困惑,使用笛卡尔或UTM更适合吗?

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?

如何将GPS转换为UTM?我已经搜索过,但有点困惑.某些转换涉及度数分钟和秒,我的GPS似乎给了我一个额外的数字,因此它的N 68.21.446和`w 12.14.284

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 additional number to this, so its N 68.21.446 and `w 12.14.284

如果与它有关,我假设在我的计算中该区域为2d,以使事情变得简单一些.

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

这是代码,尽管我不确定是否需要它:

Here is the code though I'm not sure it's 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

`

推荐答案

坐标系转换是使用 rgdal 包中的 spTransform 函数完成的.您必须先将坐标转换为十进制度,然后才能将其转换为UTM坐标.

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.

那么,您的"N 68.21.446"的十进制度是多少?好吧,我不确定.它的数字为68 +(21/60),但您需要找出最后一个数字是多少.可能是一分钟的千分之一(如果它的第一个数字是6或更大,那么这似乎是可能的)或b)两位数字持续几秒钟,然后是十分之一秒.

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.

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

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

对于b)N 68.21.446为68 +(21/60)+(44/3600)+(6/36000)十进制度数.

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.

一旦获得十进制度,就用这些数字创建一个空间点数据框,将其CRS设置为GPS坐标系(可能是EPSG代码4326),然后使用 spTransform 转换为UTM代码-使用适合您经度的代码.

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.

除非其北极熊或帝企鹅并且距离不超过几十公里,否则UTM坐标应很好地近似于规则的正方形网格.更大的误差源将是您的角度测量!

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!

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

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

如果您对该程序包有任何评论,请通过该github站点将其发送给我,而不是在StackOverflow上.

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天全站免登陆