I am trying to create a Digital Earth Model (DEM) using ArcPy under ArcGIS Pro 2, but I am running into some problems.
I can generate a DEM within ArcGIS Pro by selecting only the ground points under LAS files in the LAS dataset properties, but when I try to run the same code within ArcPy, it generates a DEM using all the points.
Any ideas how you select the return point type in ArcPy?
Here is the code that I have used.
arcpy.conversion.LasDatasetToRaster(lasd, "Test_arcpy_dem", "ELEVATION", "BINNING AVERAGE LINEAR", "FLOAT", "CELLSIZE", 10, 1)
As I said, this generates two different outputs, depending if I am in ArcGIS Pro or not.
classCodes = [2]; return_Vals = ['Last Return','First of Many','Last of Many','Single Return','1','2','3','4']; dem_layer = arcpy.CreateUniqueName('dem_layer') ## new LAS dataset layer name; arcpy.MakeLasDatasetLayer_management(lasd, dem_layer,class_code=classCodes,return_values=return_Vals); arcpy.conversion.LasDatasetToRaster(dem_layer, "DEM", "ELEVATION", "BINNING AVERAGE LINEAR", "FLOAT", "CELLSIZE", 10, 1);
Note: I marked end of line with semi-colon. Not needed.