0

これは以前に答えられたかもしれませんが、私は LAT/LNG に不慣れなため、SO や Google を見てもあまり理解できませんでした。

私が見つけようとしているのは、X km離れたポイント(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