将"world file" GIS 转换为 MapKit?



我对如何将世界文件转换为左上和右下坐标以用于MAPKIT中有点困惑。我正在尝试将NOAA雷达图像放在地图上。

以下是世界文件的示例:

0.0147268399325284
0.000000
0.000000
-0.0147268399325284
-166.284681479714
64.8355168290572

这是所有世界文件的关键:

Line 1: x-dimension of a pixel in map units
Line 2: rotation parameter
Line 3: rotation parameter
Line 4: NEGATIVE of y-dimension of a pixel in map units
Line 5: x-coordinate of center of upper left pixel
Line 6: y-coordinate of center of upper left pixel

我知道,如果我有图片的左上和右上(或反之亦然),我将能够在MKMAPVIEW上显示。但是我不确定如何在MKMAPVIEW上执行世界文件,或者如何将其转换。任何帮助将不胜感激!

在第5和6行中提供的(x,y)坐标不是图像的上左界的坐标。这就是图像的大多数左上像素的中心的坐标。

Line 1: x-dimension of a pixel in map units                      = dx
Line 2: rotation parameter                                       
Line 3: rotation parameter
Line 4: NEGATIVE of y-dimension of a pixel in map units          = dy
Line 5: x-coordinate of center of upper left pixel               = centerOfULX
Line 6: y-coordinate of center of upper left pixel               = centerOfULY

您可以按以下方式计算左上和右下坐标:

upperLeftX = centerOfULX - dx/2
upperLeftY = centerOfULY + (-dy/2)
lowerRightX = (centerOfULX - dx/2) + imageWidth * dx
lowerRightY = (centerOfUL + (-dy/2)) - imageHeight * (-dy)

我能够找到将其放入左上(NW)和底部(SW)lat and Long的方程式。这是方程。

0.017971305190311 A
0.000000000000000 B
0.000000000000000 C
-0.017971305190311 D
-127.620375523875420 E
50.406626367301044 F
RESOLUTION OF PICTURE 3400 G x 1600 H pixels
CALCULATION:
E + (G*A) = EASTERN POINT
F + (H*D) = SOUTHERN POINT
RESULTS:
Lower left coordinate: 21.652538062803, -127.620375523875420
Upper right coordinate: 50.406626367301044, -66.517937876818

最新更新