Remove Files From LAS Dataset (Data Management)

Summary

Removes one or more LAS format files and surface constraint features that are referenced by a LAS dataset.

Usage

  • Directory paths must be provided using the folder separator associated with the operating system.

  • A LAS dataset with a display pyramid is not supported in ArcGIS Pro releases earlier than version 2.6. Removing the pyramid will allow the LAS dataset to be usable in earlier versions of the software. This tool can be used to delete the pyramid to allow those applications to use the LAS dataset. However, creating a new LAS dataset for those applications is preferable since the processing time for generating the display pyramid is significantly greater than the time for creating the new LAS dataset. The file references from the LAS dataset with the display pyramid can be added to the new LAS dataset by specifying the existing LAS dataset as an input. Only consider deleting the display pyramid if a different pyramid point selection method will be used.

Parameters

LabelExplanationData Type
Input LAS Dataset

The LAS dataset that will be processed.

LAS Dataset Layer
LAS Files or Folders
(Optional)

The name of the LAS format files (*.las, *.zlas, and *.laz) that will be removed from the LAS dataset. If a folder is specified, all the LAS format files in the folder will be removed, but files that reside in subdirectories of the folder will be maintained.

String
Surface Constraints
(Optional)

The name of the surface constraint features that will be removed from the LAS dataset. Surface constraint features need only be cited by their name, not their extension or path. For example, boundary.shp and sample.gdb/boundary are referred to as boundary.

String
Delete pyramid
(Optional)

Specifies whether the LAS dataset's display pyramid will be deleted.

  • Checked—The LAS dataset's display pyramid will be deleted.
  • Unchecked—The LAS dataset's display pyramid will not be deleted. This is the default.
Boolean

Derived Output

LabelExplanationData Type
Updated LAS Dataset

The updated LAS dataset.

LAS Dataset Layer

arcpy.management.RemoveFilesFromLasDataset(in_las_dataset, {in_files}, {in_surface_constraints}, {delete_pyramid})
NameExplanationData Type
in_las_dataset

The LAS dataset that will be processed.

LAS Dataset Layer
in_files
[in_files,...]
(Optional)

The name of the LAS format files (*.las, *.zlas, and *.laz) that will be removed from the LAS dataset. If a folder is specified, all the LAS format files in the folder will be removed, but files that reside in subdirectories of the folder will be maintained.

String
in_surface_constraints
[in_surface_constraints,...]
(Optional)

The name of the surface constraint features that will be removed from the LAS dataset. Surface constraint features need only be cited by their name, not their extension or path. For example, boundary.shp and sample.gdb/boundary are referred to as boundary.

String
delete_pyramid
(Optional)

Specifies whether the LAS dataset's display pyramid will be deleted.

  • DELETE_PYRAMIDThe LAS dataset's display pyramid will be deleted.
  • NO_DELETE_PYRAMIDThe LAS dataset's display pyramid will not be deleted. This is the default.
Boolean

Derived Output

NameExplanationData Type
derived_las_dataset

The updated LAS dataset.

LAS Dataset Layer

Code sample

RemoveFilesFromLasDataset example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window:

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.management.RemoveFilesFromLasDataset("test.lasd", 
                                           "LA_N; LA_S/LA_5S4E.las",
                                           "boundary.shp; streams.shp")
RemoveFilesFromLasDataset example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script:

'''*********************************************************************
Name: Modify Files in LAS Dataset& Calculate Stats for LASD
Description: Adds files & surface constraints to a LAS dataset, then
             calculates statistics and generates report.
*********************************************************************'''
# Import system modules
import arcpy

try:
    # Script variables
    arcpy.env.workspace = 'C:/data'
    lasd = 'sample.lasd'
    oldLas = ['2006', '2007/file2.las']
    newLas = ['2007_updates_1', '2007_updates_2']
    oldSurfaceConstraints = ['boundary.shp', 'streams.shp']
    newSurfaceConstraints = [['sample.gdb/boundary', '<None>',
                              'Soft_Clip']
                             ['sample.gdb/streams', 'Shape.Z',
                              'Hard_Line']]
    arcpy.management.RemoveFilesFromLasDataset(lasd, oldLas,
                                               oldSurfaceConstraints)
    arcpy.management.AddFilesToLasDataset(lasd, newLas, 'RECURSION',
                                          newSurfaceConstraints)
    arcpy.management.LasDatasetStatistics(lasd, "UPDATED_FILES",
                                          "lasd_stats.txt",
                                          "LAS_FILE", "DECIMAL_POINT",
                                          "SPACE", "LAS_summary.txt")
except arcpy.ExecuteError:
    print(arcpy.GetMessages())
except Exception as err:
    print(err.args[0])

Environments

Licensing information

  • Basic: Requires 3D Analyst or Spatial Analyst
  • Standard: Yes
  • Advanced: Yes

Related topics