在ArcGIS上堆叠3D拉伸

问题描述 投票:-1回答:1

是否有任何方法可以将我的3D拉伸彼此堆叠在一起?例如,如果我有纽约市的几何图形,我想从底部挤​​出一种颜色的大约5m,然后从一种颜色挤出的5m到10m,等等。有点像制作堆积的条形图,但是更地理的方式。任何输入将不胜感激!

gis arcgis qgis arcgis-js-api
1个回答
0
投票

这可以通过使用图层上的elevationInfo属性拉伸几何并将其放置在特定高度来实现。下面的示例假设您有一个具有多边形几何形状的图层(例如elevationInfoFeatureLayer)。

对于拉伸,告诉图层使用GeoJSONLayer渲染多边形。在下面的代码段中,所有多边形的高度均为5米。

ExtrudeSymbol3DLayer

之后,可以通过将拉伸的多边形放置在特定的高度ExtrudeSymbol3DLayer上来使其飞出。下面的示例将渲染距离地面10米的所有多边形。

layer.renderer = {
  type: "simple",
  symbol: {
    type: "polygon-3d",
    symbolLayers: [
      {
        type: "extrude",
        size: 5, // height in meters
        material: {
          color: "red"
        }
      }
    ]
  }
}

这些多边形都不会出现堆叠,因为它们都具有与地面相同的颜色,高度和标高。我们基本上希望在上面的代码片段中为每个多边形设置不同的值。

下面的示例代码通过添加来实现

  • relative-to-groundlayer.elevationInfo = { mode: "relative-to-ground", offset: 10, unit: "meters" } 表达式
  • a Arcade表示多边形的突出高度
  • elevationInfo为每个多边形使用不同的颜色

它们都取决于多边形要素的属性,因此可以通过更改属性的值进行调整。

VisualVariable

这里是一个正在运行的示例,显示了纽约中央公园的一些拉伸多边形。UniqueValueRenderer

// Make elevation offset depend on the attribute "elevation" layer.elevationInfo = { mode: "relative-to-ground", featureExpressionInfo: { expression: "$feature.elevation" }, unit: "meters" }; layer.renderer = { type: "unique-value", visualVariables: [ // Make the extrusion height depend on the attribute "height" { type: "size", valueExpression: "$feature.height", valueUnit: "meters" } ], // Make the color depend on the attribute "usage" field: "usage", uniqueValueInfos: [ { value: "office", symbol: { type: "polygon-3d", symbolLayers: [ { type: "extrude", material: { color: "#D06152" } } ] } }, ... // Add unique value info for each usage ] };

© www.soinside.com 2019 - 2024. All rights reserved.