我需要在 php 或 javascript 中找到 kml 文件中给出的地面覆盖层的纬度/经度角。
即对于一个具体的例子,我需要从:
<LatLonBox>
<north>60.406505416667</north>
<south>60.400570555556</south>
<east>5.3351572222222</east>
<west>5.3190577777778</west>
<rotation>3.7088732260919</rotation>
</LatLonBox>
转角坐标
SW: 60.400316388889;5.3194425
SE: 60.400824722222;5.3355405555556
NE: 60.406759444444;5.3347738888889
NW: 60.406251388889;5.3186730555556
我可以通过另一种方式(大约至少,给出的php代码)
$w=($nw_lng+$sw_lng)/2;
$e=($ne_lng+$se_lng)/2;
$n=($ne_lat+$nw_lat)/2;
$s=($se_lat+$sw_lat)/2;
$rot= rad2deg (atan ( ( $nw_lng - $sw_lng ) / ($sw_lat - $nw_lat ) / 2 ) );
应该很容易回来,但我已经为此花费了几个小时而没有到达那里。有小费吗?