KML 和高度

KML and altitude

我有以下 KML 文件,它是一个立方体 =>

</Placemark>
<Style id="3Dobject">
    <PolyStyle>
        <color>7fff5500</color>
        <outline>1</outline>
        <fill>1</fill>
    </PolyStyle>
</Style>
<Placemark>
    <name>Warehouse01</name>
    <description>Warehouse Center:106.97777777 -6.19758333</description>
    <styleUrl>#3Dobject</styleUrl>
    <Polygon>
        <extrude>1</extrude>
        <tessellate>1</tessellate>
        <altitudeMode>absolute</altitudeMode>
        <outerBoundaryIs>
            <LinearRing>
                <coordinates>
                    106.9772778,-6.19808333,100
                    106.9782778,-6.19808333,100
                    106.9782778,-6.19708333,100
                    106.9772778,-6.19708333,100
                    106.9772778,-6.19808333,100
                </coordinates>
            </LinearRing>
        </outerBoundaryIs>
    </Polygon>
</Placemark>

我试图让这个立方体在离地面 100 米的地方绘制。 (

所以基本上=>

我尝试添加一个 100,但它总是从底部显示。

我正在使用 CESIUM。

选项 1:具有 6 个多边形的 MultiGeometry

根据定义extrude 使 KML 中的几何图形连接到地面。要在地面上方创建 3-D 立方体,您必须关闭拉伸并为立方体的 6 个面中的每一个面表示一个多边形。

示例:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">

<Placemark>
  <name>Altitude PolyCube Example</name>
  <Style>
    <PolyStyle>
        <color>7fffffff</color>
    </PolyStyle>
  </Style>
  <MultiGeometry>
    <Polygon>
      <!-- bottom panel -->
      <altitudeMode>absolute</altitudeMode>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
     106.9772778,-6.19808333,100
     106.9782778,-6.19808333,100
     106.9782778,-6.19708333,100
     106.9772778,-6.19708333,100
     106.9772778,-6.19808333,100
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>

    <Polygon>
      <!-- top panel -->
      <altitudeMode>absolute</altitudeMode>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
     106.9772778,-6.19808333,200
     106.9782778,-6.19808333,200
     106.9782778,-6.19708333,200
     106.9772778,-6.19708333,200
     106.9772778,-6.19808333,200
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>

    <Polygon>
      <!-- left panel -->
      <altitudeMode>absolute</altitudeMode>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
     106.9772778,-6.19808333,100
     106.9772778,-6.19808333,200
     106.9772778,-6.19708333,200
     106.9772778,-6.19708333,100
     106.9772778,-6.19808333,100
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>

    <Polygon>
      <!-- right panel -->
      <altitudeMode>absolute</altitudeMode>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
    106.9782778,-6.19808333,100
    106.9782778,-6.19808333,200
    106.9782778,-6.19708333,200
    106.9782778,-6.19708333,100
    106.9782778,-6.19808333,100
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>

    <Polygon>
      <!-- front panel -->
      <altitudeMode>absolute</altitudeMode>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
     106.9772778,-6.19808333,100
     106.9782778,-6.19808333,100
     106.9782778,-6.19808333,200
     106.9772778,-6.19808333,200
     106.9772778,-6.19808333,100
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>

    <Polygon>
      <!-- back panel -->
      <altitudeMode>absolute</altitudeMode>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>
     106.9772778,-6.19708333,100
     106.9782778,-6.19708333,100
     106.9782778,-6.19708333,200
     106.9772778,-6.19708333,200
     106.9772778,-6.19708333,100
          </coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>

  </MultiGeometry>
</Placemark>

</kml>

选项 2:KML 和 COLLADA 立方体模型

给定一个通用的立方体模型(您可以在 3D Warehouse 下载),KML 可以将立方体放置在给定位置,包括高于地面的高度。

选项 3:铯

Cesium 使用 Box 几何结构,因此可以简单地将 Box 放置在给定的 100 米高度。例如参见 [​​=13=].