【问题标题】:How to find lat/long coordinates in a image, If we have lat/long of 4 corners如何在图像中找到纬度/经度坐标,如果我们有 4 个角的纬度/经度
【发布时间】:2019-11-04 07:04:43
【问题描述】:

我有一张图片。我知道所有 4 个角的纬度和经度。我想找到一个特定点的纬度和经度。

在下图中,我知道所有 4 个角的纬度/经度(红点)。我想找到蓝点的纬度/经度。我知道这张图片中蓝点的像素坐标。比方说,它是 200px 左边和 233px 底部(从顶部)。

【问题讨论】:

标签: python math location


【解决方案1】:

我得到了答案:这是 Python 代码

def GetLatandLong(top_Left_Lat, top_Left_Long, bottom_Right_Lat, bottom_Right_Long,img_Width,img_Height, target_Top, target_Left):
    diff_Between_Top_Bottom_Lat = bottom_Right_Lat - top_Left_Lat
    percentage_Of_Total_Lat_In_Picture = diff_Between_Top_Bottom_Lat/90*100
    image_Size_Height_Required_To_Cover_Entire_Earth = img_Height/percentage_Of_Total_Lat_In_Picture*100
    top_Left_Percentage_Of_Lat = top_Left_Lat/90*100
    top_Left_Pixel_In_Image = image_Size_Height_Required_To_Cover_Entire_Earth*top_Left_Percentage_Of_Lat/100
    target_Pixel_In_Whole_Earth_Image = top_Left_Pixel_In_Image + target_Top
    percentage_Of_Target_In_Image = target_Pixel_In_Whole_Earth_Image/image_Size_Height_Required_To_Cover_Entire_Earth*100    
    target_Lat = percentage_Of_Target_In_Image*90/100


    diff_Between_Top_Bottom_Long = bottom_Right_Long - top_Left_Long
    percentage_Of_Total_Long_In_Picture = diff_Between_Top_Bottom_Long/180*100
    image_Size_Width_Required_To_Cover_Entire_Earth = img_Width/percentage_Of_Total_Long_In_Picture*100
    top_Left_Percentage_Of_Long = top_Left_Long/180*100
    top_Left_Pixel_In_Image = image_Size_Width_Required_To_Cover_Entire_Earth*top_Left_Percentage_Of_Long/100
    target_Pixel_In_Whole_Earth_Image = top_Left_Pixel_In_Image + target_Left
    percentage_Of_Target_In_Image = target_Pixel_In_Whole_Earth_Image/image_Size_Width_Required_To_Cover_Entire_Earth*100    
    target_Long = percentage_Of_Target_In_Image*180/100






    return target_Lat,target_Long


target_Lat,target_Long = GetLatandLong(52.871983, 8.642317, 52.869069, 8.659905,1200,218, 180, 650)

print(target_Lat,target_Long)

【讨论】:

    【解决方案2】:

    看看geodesyintermediatePointTo函数。 Here解释。 它在 JavaScript 中,但您可以轻松地将其转换为 Python。

    【讨论】:

      猜你喜欢
      • 2013-02-23
      • 1970-01-01
      • 2013-02-14
      • 2021-06-27
      • 1970-01-01
      • 2022-01-08
      • 2011-09-03
      相关资源
      最近更新 更多