之前可能会回答这个问题,但是看起来我或谷歌我不太了解,因为我是LAT / LNG的新手。
我想要找到的是在X公里外的一个点(纬度,纬度)附近获得4点(纬度,纬度)。
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.
任何建议都会非常有用。