本文介绍了两个地理位置之间的距离?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给定两个地理位置(两个纬度/经度对),如何获得准确的距离(以米为单位)?
How do I get an accurate distance (in meters) given two geo-points (two latitude/longitude pair) ?
推荐答案
iPhone上没有测距功能,可以为您提供2米的分辨率.您可以使用Core Location的 -[CLLocation distanceFromLocation: otherLocation]
方法来获取两个位置之间的以米为单位的位移,但请记住:
There's no distance measurement on the iPhone that will give you a resolution of 2 meters. You can use Core Location's -[CLLocation distanceFromLocation: otherLocation]
method to get a displacement in meters between two locations, but bear in mind:
- 我从没见过Apple解释过使用什么大地坐标作为坐标,以及对于不同的位置推算,它实际上是否是同一个大地坐标
- 他们使用的模型没有考虑到海拔高度,这对于计算野外大小区域中人类大小的物体之间的距离非常不利.不过,估算伦敦和莫斯科之间的距离很好-误差很小.
- 在不插入设备的情况下,结合使用高精度的位置数据和运动检测功能,将完全消耗电池电量
- 在不使用运动检测的情况下,您只能说出设备的位置在几十米之内.
- nowhere that I've seen does Apple explain what geode is used for their coordinates, and indeed whether it's the same geode for different reckonings of position
- the model they use doesn't take altitude into account, which is pretty crappy for working out the distances between human-sized objects in a field-sized area. It's fine for reckoning the distance between London and Moscow, though - the error is small.
- when your device isn't plugged in, using really-high precision location data combined with motion detection is going to completely suck the battery
- without using motion detection, you can only tell where the device is to within tens of metres.
这篇关于两个地理位置之间的距离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!