坐标格式错误(wgs84)或者我遗漏了什么?
这里是虚拟问题。我正在开发一个可获取位置感知信息的应用程序。我通过以下方式获取位置坐标: lat=+aaa.bb.cc.dd&lon=+aaa.bb.cc.dd&datum=wgs84
如何将这些坐标转换为带有单点的标准纬度经度。现在看起来好像客户端正在请求 IP 地址查找。
Dummy question here. I'm developing an app that fetches location-aware info. I'm getting location coordinates in following manner: lat=+aaa.bb.cc.dd&lon=+aaa.bb.cc.dd&datum=wgs84
How do I convert those coordinates into standard latitude longitude with single dot. Now it looks as if client is requesting an ip address lookup.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
获取包含 wgs84 坐标的字符串,将其按句点分割,将结果从文本
'34'
转换为数字34
,然后进行转换所需的除法添加到纬度(或经度)的浮点调整的分钟、秒和秒分数。Takes the string with the wgs84 coordinate in it, splits it on the periods, converts the results from text
'34'
to numeric34
, and then does the division necessary to convert the minutes, seconds, and fractions of seconds to floating point adjustments added to the latitude (or longitude).受到 @Myrddin 几乎同意他犯了一个小错误的鼓舞,我发布了一个答案,公然试图收集代表。
我怀疑
应该解释为 123d12m34.56s 并转换为十进制度,如下所示:
Emboldened by @Myrddin's near-agreement that he made a small mistake, I'm posting an answer in a blatant attempt to gather rep.
I suspect that
should be interpreted as 123d12m34.56s and converted to decimal degrees like this: