都市の経度/緯度の位置をデカルトに変換しようとしていますので、これをピクセル位置に変換してパイゲーム画面に表示できます。経度/緯度をデカルト座標に変換しようとしています
def ConvertPoint(self, Long, Lat, height, width):
self.x = Long
self.y = Lat
self.x = angleToPointX(self.x, self.y, 3959)
self.y = angleToPointY(self.x, self.y, 3959)
pygame.draw.circle(self.window, (255,0,0), (int(self.x), int(self.y)), 5)
print(self.x, self.y)
機能:
def angleToPointX(lat, long, magnitude=1.0):
V = (math.cos(lat) * math.cos(long))
return V
def angleToPointY(lat, long, magnitude=1.0):
V = (math.sin(lat))
return V
可能複製(http://stackoverflow.com/questions/1185408/を通して私を助けたものです経度 - 経度 - 経緯 - 座標間接座標) –
あなたの質問は何ですか? –
Levさんのように、何が問題なのですか? –