开发者

How to show user's location in an aerial photo using latitude and longitude from the gps?

开发者 https://www.devze.com 2023-03-11 01:32 出处:网络
I\'m a programmer and I\'m developing an application in androi开发者_StackOverflowd. This is my problem:

I'm a programmer and I'm developing an application in androi开发者_StackOverflowd. This is my problem: I have an aerial photo of a flat site (not a big site) and I want to see the user location in this photo. I got the user's latitude and longitude from the gps in the android but I don't know how to translate the latitude and longitude into an x,y coordinates in the image. I have all 4 corners of the map in a latitude longitude form. Please if anyone of you know the answer this will help me !!!!


Simply calculate how far from the edge of the zone they are, and multiply that by the size of the image.

In pseudocode:

x = (longitude - min_longitude) / (max_longitude - min_longitude) * image_width
y = (latitude - min_latitude) / (max_latitude - min_latitude) * image_height
0

精彩评论

暂无评论...
验证码 换一张
取 消