1

I need to load a set of 2D polygon features into a SceneView in ArgGIS JS API 4.11 from one of the following file types: GeoJSON, KML, or ShapeFile.

I currently can get the data as either geojson, KML, or ShapeFile. I was able to use a GeoJSONLayer to get it into my SceneView, and the actual layer renders using a SimpleRenderer with simple-fill. However, I need to project these polygons into 3D, probably by using PolygonSymbol3D and ExtrudeSymbol3DLayer in the renderer. The problem is that GeoJSONLayer does not support ExtrudeSymbol3DLayer as of ArcGIS API 4.11. So I guess I need to find a different way to load the features in that would support the use of ExtrudeSymbol3DLayer.

I wanted to be able to use KMLLayer, but KMLLayer support for SceneView is also not available for ArcGIS API 4.11.

Is there any way to get a set of 2D polygon features defined as GeoJSON to be a 3D polygon layer in ArcGIS JS API 4.11?

Here's my current layer implementation for a 2D layer in a SceneView:


let layer = new GeoJSONLayer({
        title: "My Layer",
        url: "http://localhost/data/layer.geojson",
        renderer: {
            type: "simple",
            symbolLayers: [{
                type: "simple-fill", 
                material: { color: "orange" }
            }]
        }
        minScale: 0,
        opacity: 0.40,
        geometryType: "polygon"
    });

And here's an idea of what my GeoJSON looks like:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type":"Feature",
      "properties":{
        "name":"Feature 1",
        ...
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [[[...]]]
      }
    },
    ...
  ],
}
oaky_afterbirth
  • 125
  • 3
  • 15

1 Answers1

1

You can use the ExtrudeSymbol3DLayer with a GeoJSONLayer. Use a renderer that looks something like this:

var renderer = {
  type: "simple", // autocasts as new SimpleRenderer()
  symbol: {
    type: "polygon-3d", // autocasts as new PolygonSymbol3D()
    symbolLayers: [
      {
        type: "extrude", // autocasts as new ExtrudeSymbol3DLayer()
        material: { color: "red" },
        edges: {
          type: "solid", // autocasts as new SolidEdges3D()
          color: [50, 50, 50, 0.5]
        }
      }
    ]
  },
  label: "Population Density per County",

  // these visual variables are the key to "Extruding" the polygons
  visualVariables: [
    {
      type: "size",
      axis: "height",

      field: "pop_2000",
      normalizationField: "sq_miles",
    }
  ]
};

Full demo here.

GavinR
  • 6,094
  • 7
  • 33
  • 44