我的问题是如何从当前位置找到特定区域 (500米) 的最小和最大纬度和经度.
My Question is how can i find minimum and maximum latitude and longitude of specific area (500 meter) from current location.
就我而言,例如,我需要获取 X 和 Y CLLocation (纬度和经度)从 500 面积米看到我的图片(很抱歉,这张照片可能不好用)
In my case, Such like i need to get X and Y CLLocation (latitude and longitude) from 500meter of area See my image (sorry for this may be bad drawing )
我还必须尝试使用Google谷歌搜索功能,并且获得类似
I also have to tried to googling and i got link such like
我如何才能使用当前位置和半径获取最小和最大纬度和经度?
但是我不知道它如何实现.
But i don't know how it implement in my case.
请帮助我解决这个问题.
Pleas help me in this issue.
注意:我不想使用 CLLocationDistance distance = [currentLocation distanceFromLocation:newLocation]; ,因为它对我的情况没有帮助.
NOTE : I do not want to use CLLocationDistance distance = [currentLocation distanceFromLocation:newLocation]; because it is not helpful in my case so..
推荐答案如果您不需要真正精确的值,请使用 1度为111公里.基于此,您需要在当前坐标上添加和删除0.0025度,以获取所需区域的角.
If you don't need a really precise value, then use the approximation that 1 degree is 111 km. Based on this, you need to add and remove 0.0025 degrees to the current coordinates to get corners of the area you are looking for.
rectanglesidelengthmeters = 500 degreedeltalat = 0.001 * (rectanglesidelengthmeters / 2.0) * cos(current.lon) degreedeltalon = 0.001 * (rectanglesidelengthmeters / 2.0) * cos(current.lat) minlat = current.lat - degreedeltalat maxlat = current.lat + degreedeltalat minlon = current.lon - degreedeltalon maxlon = current.lon + degreedeltalon您可能需要稍微校正一下结果,以使纬度值保持在-90 .. 90范围内,经度值保持在-180 .. 180范围内,但我认为CLClocation也会为您处理.
You may need to correct the result a little for staying in the -90 .. 90 range for latitude and -180 .. 180 range for longitude values but I think CLClocation will handle that for you too.
更多推荐
查找最小/最大纬度和经度
发布评论