1

我试图在地图上找到阻挡圆圈(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 公式)

4

1 回答 1

4

它确实仅取决于纬度(因为当您向两极移动时,圆圈会变小)。

Latitude:  1 deg = 110.54 km
Longitude: 1 deg = 111.320*cos(latitude) km
于 2014-05-26T18:13:48.343 回答