在较高海拔处生成具有地球曲率的KML lineString坐标

时间:2012-04-29 16:34:39

标签: kml google-earth

我需要在具有地球曲率的更高海拔处的两个点之间创建一个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>

示例2是期望的结果,但是有更简单的方法来实现这一点,还是需要某种算法来计算沿着路线的起点和终点之间的点以实现地球的曲率?

0 个答案:

没有答案