0

这之前可能已经回答过了,但是看着 SO 或谷歌,我无法理解很多,因为我是 LAT/LNG 的新手。

我试图找到的是在 X 公里外的一个点(lat,lng)周围获得 4 个点(lat,lng)。

例子

class Point():
    def __init__(lat, lng):
        self.lat = lat
        self.lng = lng


#I have a point.
orginal_point = Point (46.227638, 2.213749)  
# I want to get p1, p2, p3, p4 which forms a square around the actual point.
distance_apart = 100 # in KM
p1_lt = Point(0,0) # Left Top corrnor of saqure
p2_lb = Point(0,0) # Left bottom corrnor of saqure
p3_rt = Point(0,0) # Right Top corrnor of saqure
p4_rb = Point(0,0) # Right bottom corrnor of saqure

# When I have those points. I want to query system to find all the nodes which lies under that square.
cls.objects.filter() # Thinking about how to query.

任何建议都会非常有帮助。

4

0 回答 0