我试图找到在地图上挡住圆(a,b,R)的点,问题是随着经度的变化,地图上使用的坐标会转换为不同的度量值。我知道这和弧度有关。这是缺少部分的代码:
class Circle(object):
def __init__(self,x,y,R):
self.x = x #Degrees
self.y = y #Degrees
self.R = R #meters
def getRatio(self,x,y):
#This is where the magic happens...
return latRatio, LatRatio
def getBlockingSquareCords(self):
latRation, lonRatio = getLonRatio(x,y)
latD = self.R/latRatio
lonD = self.R/lonRatio
x1 = self.x+latD
y1 = self.y+lonD
x2 = self.x-latD
y2 = self.y-lonD
return (x1,y1,x2,y2)
以下问题对答案有一些提示,但我无法弄清楚-计算两个纬度-经度点之间的距离?(Haversine公式)
它确实仅取决于纬度(因为当您向两极移动时,圆圈会变小)。
Latitude: 1 deg = 110.54 km
Longitude: 1 deg = 111.320*cos(latitude) km
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句