GPS坐标翻译
我正在使用 VisionTek 的型号为 86VT 的设备开发 GPS 跟踪网站
http://www.visiontek.co.in/vehicle-tracking-systems/86vt.html
我能够获取设备位置,但无法像我们在谷歌地图中使用的那样正确解析它。 为了。前任。我得到维沙卡帕特南的以下经度,在谷歌地图位置的原始坐标中为 17.xxx。
17480249N
我不知道这是什么格式,以及如何将 17480249N 转换为 17.xxx 。 我还知道“N”代表正值。
请帮忙,我正在使用 PHP,但任何逻辑都会受到赞赏。
这就是我从设备获取响应的方式。请参阅粗体文字了解坐标,我靠近维沙卡帕特南海滩。
$1,GlamourBik,14,11,10,14,40,08,17434800N,083185195E,02.1,13,0,0,A#
$2,GlamourBik,14,11,10,14,45,08,17440069N,083187747E,19.8,12,1,0,A#
$1,GlamourBik,14,11,10,16,53,42,17440319N,083176376E,00.3,178,1,0,A#
$1,GlamourBik,14,11,10,16,58,41,17440319N,083176376E,00.0,166,1,0,A#
$1,GlamourBik,14,11,10,17,03,42,17440319N,083176376E,00.0,42,1,0,A#
I am developing GPS tracking web site with a device from VisionTek with the model no 86VT
http://www.visiontek.co.in/vehicle-tracking-systems/86vt.html
I am able to get the device location but could not parse it correctly as we use in google maps.
For. Ex. I am getting the following longitude for Visakhapatnam which is 17.xxx in original Coordinate in google maps location.
17480249N
I dont know what is this format, and how to convert 17480249N to 17.xxx .
I also know that "N" is for positive values.
Please help, I am using PHP, but any logic will be appreciated.
This is how I am getting the response from device. Please see the bold text for coordinates, I am near to Visakhapatnam beach.
$1,GlamourBik,14,11,10,14,40,08,17434800N,083185195E,02.1,13,0,0,A#
$2,GlamourBik,14,11,10,14,45,08,17440069N,083187747E,19.8,12,1,0,A#
$1,GlamourBik,14,11,10,16,53,42,17440319N,083176376E,00.3,178,1,0,A#
$1,GlamourBik,14,11,10,16,58,41,17440319N,083176376E,00.0,166,1,0,A#
$1,GlamourBik,14,11,10,17,03,42,17440319N,083176376E,00.0,42,1,0,A#
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你确定这不是纬度? (N 应该表示北,经度表示东/西)
在 javascript 中,这可能应该满足您的要求。
使用
getUsable('17480249N')
将返回 google-地图友好版本。我假设格式是六位浮点精度的整数表示。
N 是正数,因为它表示北,而不是南,而南应该是负数。
E(东)和 W(西)相同。
演示位于 http://jsfiddle.net/gaby/Rjk8e/
更新
在更新完整坐标和 @wallyk 的答案后,这里是一个可以计算 DMS 格式坐标的版本。
演示位于 http://jsfiddle.net/gaby/Rjk8e/1/
示例
是您问题中的第一个坐标 17434800N、083185195E 中的任意一个(都在海中)
位于谷歌地图使用第一种方法进行翻译
或
<一href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=17.729999999999997,%2083.54033055555556&aq=&sll=13.531665,87.53 9586&sspn=13.194946,17.753906&g=17.729999999999997,%2083.54033055555 556&ie=UTF8&ll=17.672811,83.251648&spn=1.619837,2.219238&z=9" rel="nofollow">Google 地图使用 DMS 方法进行翻译 ?
Are you sure it is not Latitude ? (N should mean North and Longitude is for East/West)
In javascript this should probably do what you want..
using
getUsable('17480249N')
will return the google-map friendly version.I assume that the format is an integer representation of six digit floating precision.
N is positive because it denotes North as opposed to South which should be negative.
Same for E (east) and W (west).
Demo at http://jsfiddle.net/gaby/Rjk8e/
Update
After your update with full coordinates and the answer from @wallyk, here is a version that can calculate the coords if they are in DMS format.
Demo at http://jsfiddle.net/gaby/Rjk8e/1/
Examples
Is the first coordinate in your question 17434800N, 083185195E located at any (both are in the sea) of
google map using translation by first method
or
google map using translation by DMS method ?
维萨卡帕特南 位于北纬 17° 42′,东经 83° 15′ 或,以有符号十进制 + 17.7°,+83.25°。由于维萨卡帕特南相当大,17480249可能意味着 17° 48' 2.49 ",距离 EESE 约 2.5 公里。
这就是 GPS 装置为 NMEA 0183 总线。
将数量作为字符串处理。对于纬度,使用第一对数字作为度,第二对数字作为分,第三对数字作为秒,任何其他数字作为秒小数点后的数字 对于经度,使用前三位数字作为度,其余数字。数字与纬度的转换方式相同。
要将度、分和秒 (DMS) 转换为度,请使用公式
D + M/60.0 + S/3600.0
。Visakhapatnam is located at 17° 42′ N, 83° 15′ E or, in signed decimal +17.7°, +83.25°. Since Visakapatnam is fairly large, 17480249 probably means 17° 48' 2.49 ", which is about 2.5 km away EESE.
This is how GPS units format their data for the NMEA 0183 bus, for example.
Handle the quantities as a string. For the latitude, use the first pair of digits as degrees, the second pair as minutes, the third pair as seconds, and any additional digits as digits after the seconds' decimal point. For longitude, use the first three digits as degrees, and the remaining digits the same way as latitude.
To convert degrees, minutes, and seconds (DMS) to degrees, use the formula
D + M/60.0 + S/3600.0
.该格式在此页面上不存在
http://en.wikipedia.org/wiki/Geographic_coordinate_conversion
我的建议多收集一些城市的数据,希望能从中找出规律。
That format is nowhere on this page
http://en.wikipedia.org/wiki/Geographic_coordinate_conversion
My suggestion is to collect some data for some more cities and hope that you can pick out a pattern.