How to create a plane 3D surface and cut it with a raster

434
1
05-08-2023 04:21 AM
Labels (2)
Benni1801
New Contributor II

Hi,

I have the following problem, I have xyz/ raster data of a lake, for this lake I want to create a plane surface at a certain height and cut it where this height intersects with the raster layer. So basically I want to  create the water surface, creating a 3D plane is not a problem but the problem I have is, that I don't know a way to cut the new layer at the borders where it hits the land. Is there any geoprocessing tool that offers something like this or do I have to do a workaround, I also thought about cutting the raster at that height and then extract by mask but I am not sure if it would work like that.

0 Kudos
1 Reply
MicZatorsky_AEC
Occasional Contributor III

Use Spatial Analyst's CON function to replace all raster cells in the larger DEM that are covered by the lake with the lake's constant elevation values creating a flat surface where the lake is.

In the scenario below I'm using a raster for lakes that is the same size as the main DEM.  Its values are all Null except for the lake surface, where the values are all the lake's elevation.

In Python is sort of:

from arcpy.sa import *

# input the as-is DEM and the lakes I want to burn in
dem = r"C:\tmp\DEM_2014.tif"
lakes = r"c:\tmp\data.gdb\lakes_ras
sr = arcpy.Describe(dem).spatialReference

with arcpy.EnvManager(outputCoordinateSystem=sr,
snapRaster=dem,
extent="MAXOF"):

demras = Raster(dem) # where lakes
lakesras = Raster(lakes) # where lakes points to the flat lakes geotiff

# if the lakes raster is null, use a value from the DEM, else use the value from the flat lakes raster
newras = Con(IsNull(lakesras),demras,lakesras)
newras.save(dem_with_lakes)
 

  

0 Kudos