经纬度方向 [英] Direction from latitude and longitude

查看:117
本文介绍了经纬度方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有经度和纬度值,我必须从中计算方向(NE,NW,SE,SW).我已经计算了方向,但是我总是得到东南方向.请指导我如何从纬度和经度计算方向.

我是根据纬度和经度的+ ve和-ve值进行计算的.如果纬度"是+ ve,则它是北方向,否则是南方向;如果经度"是+ ve,则其经度是东,否则为西.例如:纬度= 40.6331,经度= -89.3985,因此方向=西北"是正确的方法吗?

谢谢

Hi,
I have the latitude and longitude values and I have to calculate the direction(NE,NW,SE,SW) from it. I have calculated the direction but I always get SE direction. Please guide me how to calculate the direction from latitude and longitude.

I am calculating it on the basis of +ve and -ve value of latitude and longitude. If Latitude is +ve it is in the North direction else in the South direction, same for Longitude if it is +ve the it is in East otherwise in West. e.g: Latitude = 40.6331 and Longitude = -89.3985 so Direction = "NW" Is it the correct way?

Thanks

推荐答案

您刚刚犯了一个错误.想谈谈吗?

我的意思是,没有关于如何计算的特殊说明-只需进行逐步调试即可.如果没有帮助(叹息...),那么,发布您的代码,您可能会得到一些帮助.

(严重的是,最好自己做.但是,如果您决定发布(失败的)代码,请更新您的问题,使用改善问题".
重要!不要发布答案!它将被删除.您还可以添加评论"并回复任何现有评论.)

—SA
You just made a bug. Want to talk about it?

I mean, there are not special instructions how to calculate it — just do it and debug your code step by step. If it does not help (sigh...), well, post your code, the you might get some help.

(Seriously, better do it yourself. But if you decide to post your (failed) code, please update your Question, use "Improve Question".
Important! Do not post an Answer! It will be removed. You can also "Add comment" and reply any existing comment.)

—SA


在获取经纬度值的地方..,通常任何GPS单位都会以NMEA等特定格式为您提供数据

因为只有你才能得到指示

请参阅以下有关NMEA的示例数据

Where you are getting this lat,lag values.., Normally any GPS unit gives you the data in specific format like NMEA

in that only you will get the directions also

see the below example data for NMEA

GGA - essential fix data which provide 3D location and accuracy data.


GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47 Where: GGA Global Positioning System Fix Data 123519 Fix taken at 12:35:19 UTC 4807.038,N Latitude 48 deg 07.038'' N 01131.000,E Longitude 11 deg 31.000'' E 1 Fix quality: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix 4 = Real Time Kinematic 5 = Float RTK 6 = estimated (dead reckoning) (2.3 feature) 7 = Manual input mode 8 = Simulation mode 08 Number of satellites being tracked 0.9 Horizontal dilution of position 545.4,M Altitude, Meters, above mean sea level 46.9,M Height of geoid (mean sea level) above WGS84 ellipsoid (empty field) time in seconds since last DGPS update (empty field) DGPS station ID number *47 the checksum data, always begins with *
GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47 Where: GGA Global Positioning System Fix Data 123519 Fix taken at 12:35:19 UTC 4807.038,N Latitude 48 deg 07.038'' N 01131.000,E Longitude 11 deg 31.000'' E 1 Fix quality: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix 4 = Real Time Kinematic 5 = Float RTK 6 = estimated (dead reckoning) (2.3 feature) 7 = Manual input mode 8 = Simulation mode 08 Number of satellites being tracked 0.9 Horizontal dilution of position 545.4,M Altitude, Meters, above mean sea level 46.9,M Height of geoid (mean sea level) above WGS84 ellipsoid (empty field) time in seconds since last DGPS update (empty field) DGPS station ID number *47 the checksum data, always begins with *


这篇关于经纬度方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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