我需要在具有地球曲率的较高海拔的两点之间创建一个 lineString 。按照类似于航空公司飞行路径的方式来思考视觉创意。
从上面看,在任何两个起点和终点之间都会有一条直线,但从侧面看,它会与地球的曲率相匹配。
假设这条线必须出现在地球上方 260,000 的高度。如果我只是指定起点和终点,那么这条线会长距离穿过地球。
(为了减少混乱,我将省略其余的 KML 代码,只粘贴 LineString 代码)
示例 1:
<Placemark>
<name>LineString Test</name>
<visibility>1</visibility>
<description>Test</description>
<styleUrl>#RedLine</styleUrl>
<LineString>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>
-86.1296598,38.8760649,260000
-97.7430608,30.267153,260000
</coordinates>
</LineString>
</Placemark>
如果我这样做,这条线会有一条与地球曲率相匹配的漂亮曲线。
示例 2
<Placemark>
<name>LineString Test</name>
<visibility>1</visibility>
<description>Test</description>
<styleUrl>#RedLine</styleUrl>
<LineString>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>
-86.1296598,38.8760649,260000
-87.1854235,38.0934366,260000
-88.2411872,37.3108083,260000
-89.2969509,36.52818,260000
-90.3527146,35.7455517,260000
-91.4084783,34.9629234,260000
-92.464242,34.1802951,260000
-93.5200057,33.3976668,260000
-94.5757694,32.6150385,260000
-95.6315331,31.8324102,260000
-96.6872968,31.0497819,260000
-97.7430608,30.267153,260000
</coordinates>
</LineString>
</Placemark>
示例二是期望的结果,但是有没有更简单的方法来实现这一点,或者我是否需要某种算法来计算沿路线起点和终点之间的点以实现地球曲率?