Select to view content in your preferred language

Excavate/cut terrain in 3d map

257
1
10-14-2024 04:42 AM
sab9000
Emerging Contributor

Hi!
I'm working on a web app for displaying simple buildings in 3d terrain. I want to cut into the terrain so it roughly shows how much of the ground needs to be excavated to be able to place the building (a given polygon) at a given altitude.


What would be the best way of doing this?


I'm currently using WorldElevation3D for setting the ElevationLayer in the map, rendering with SceneView.
Placing the buildings at an elevation works fine.


I saw some place that I could copy the elevation layer for the given polygon and flatten it at the elevation and put it first in the ground layers array to give it higher preference. But I'm not entirely sure how to go about doing the flattening, and will that preserve a vertical wall behind the cut out volume?


Are there any other way that is better?

0 Kudos
1 Reply
ArnoFiva
Esri Contributor

There are different approaches to achieving this. If you want to persist the altered elevation, it is best to publish the new elevation as a layer and add it as an additional elevation layer to your scene. This is something you can achieve for example with ArcGIS CityEngine: align the elevation to your buildings and publish it for a specific extent.

You can do some things also in the client using the ArcGIS Maps SDK for JavaScript. Using a base elevation layer you can change the height values that are returned by the elevation service. Here is a sample app that does this for arbitrary polygons, you can change the polygon using sketch tool: https://codepen.io/arnofiva/pen/YzoQNeq?editors=0010

Screenshot 2024-10-15 at 9.03.46 AM.png

 

0 Kudos