Add Files To LAS Dataset (Data Management)
Summary
Adds references for one or more LAS files and surface constraint features to a LAS dataset.
Usage
The LAS dataset is designed for use with airborne lidar data in the *.las format. Supported LAS file versions are 1.0, 1.1, 1.2, and 1.3.
Consider creating and managing the LAS dataset through the ArcCatalog window for a more interactive experience. See Creating a LAS dataset for more information.
Surface constraint features can be used to enforce feature-derived elevation values that represent surface characteristics in the LAS dataset.
Each LAS file typically contains spatial reference information in its header which is read by the LAS dataset. If this information is missing or incorrectly written, the LAS file can be properly georeferenced by creating an auxiliary *.prj file that shares its name, co-resides in its folder, and contains the string representation of the LAS file's coordinate system, similar to the *.prj file of a shapefile.
LAS points can be classified into a number of categories that describe the material encountered by the lidar return, such as ground, building, or water. The American Society for Photogrammetry and Remote Sensing (ASPRS) defined the following class codes for LAS file versions 1.1, 1.2, and 1.3:
Classification Value
Classification Type
0
Never Classified
1
Unassigned
2
Ground
3
Low Vegetation
4
Medium Vegetation
5
High Vegetation
6
Building
7
Noise
8
Model Key
9
Water
10
Reserved for ASPRS Definition
11
Reserved for ASPRS Definition
12
Overlap
13–31
Reserved for ASPRS Definition
Note:While the LAS 1.0 specifications provide class codes ranging from 0 to 255, it does not have a standardized classification scheme. Any class codes used in 1.0 files would typically be defined by the data vendor and provided through auxiliary information.
Syntax
Parameter | Explanation | Data Type |
in_las_dataset |
The input LAS dataset. | LAS Dataset Layer |
in_files [in_files,...] (Optional) |
Input files can reference any combination of individual LAS files and folders containing LAS data. | Folder; File |
folder_recursion (Optional) |
Specifies whether lidar data residing in the subdirectories of an input folder would get added to the LAS dataset.
| Boolean |
in_surface_constraints [[in_feature_class, height_field, SF_type],...] (Optional) | The feature classes that will be referenced by the LAS dataset. Each feature will need the following properties defined: in_feature_class—The feature class to be referenced by the LAS dataset. height_field—The field that specifies the source of elevation values for the features. Any numeric field in the feature's attribute table can be used. If the feature supports z-values, the feature geometry can be read by selecting the Shape.Z option. If no height is desired, specify the keyword <None> to create Z-less features whose elevation would be interpolated from the surface. SF_type—The surface feature type that defines how the feature geometry gets incorporated into the triangulation for the surface. Options with hard or soft designation refer to whether the feature edges represent distinct breaks in slope or a gradual change.
| Value Table |
Code Sample
The following sample demonstrates the use of this tool in the Python window:
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.AddFilesToLasDataset_management("test.lasd",
["LA_N", "LA_S/LA_5S4E.las"],
"RECURSION",
["boundary.shp <None> Soft_Clip",
"breakline.shp Shape.Z Hard_Line"])
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
from arcpy import env
import exceptions, sys, traceback
try:
# Script variables
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:
# Get the traceback object
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
# Concatenate error information into message string
pymsg = "PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}"\
.format(tbinfo, str(sys.exc_info()[1]))
msgs = "ArcPy ERRORS:\n {0}\n".format(arcpy.GetMessages(2))
# Return python error messages for script tool or Python Window
arcpy.AddError(pymsg)
arcpy.AddError(msgs)