|
|
@ -353,32 +353,27 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# read the parameters file and scroll through it
|
|
|
|
# read the parameters file and scroll through it
|
|
|
|
input_file = args.input_file
|
|
|
|
input_file = args.input_file
|
|
|
|
# input_file = 'Parameter Files/las manipulation survey2.xlsx'
|
|
|
|
input_file = 'Parameter Files/las-manipulation-survey-2.xlsx'
|
|
|
|
params_file=pd.read_excel(input_file, sheet_name="PARAMS")
|
|
|
|
params_file=pd.read_excel(input_file, sheet_name="PARAMS")
|
|
|
|
|
|
|
|
|
|
|
|
for i, row in params_file.iterrows():
|
|
|
|
for i, row in params_file.iterrows():
|
|
|
|
print("Starting to process %s" % row['Beach'])
|
|
|
|
print("Starting to process %s" % row['Beach'])
|
|
|
|
input_las1 = row['INPUT LAS1']
|
|
|
|
input_las = row['INPUT LAS']
|
|
|
|
initial_crop_poly = row['INITIAL CROP POLY']
|
|
|
|
initial_crop_poly = row['INITIAL CROP POLY']
|
|
|
|
# temp_las1 = row['TEMP LAS1']
|
|
|
|
lasground_step = row['LASGROUND STEP']
|
|
|
|
# temp_las2 = row['TEMP LAS2']
|
|
|
|
|
|
|
|
lasground_step = row['STEP VEG']
|
|
|
|
|
|
|
|
# temp_las3 = row['TEMP LAS3']
|
|
|
|
|
|
|
|
step_build = row['STEP BUILD']
|
|
|
|
|
|
|
|
temp_xyz = row['TEMP XYZ']
|
|
|
|
|
|
|
|
zone_MGA = row['ZONE MGA']
|
|
|
|
zone_MGA = row['ZONE MGA']
|
|
|
|
check_value = row['CHECK VALUE']
|
|
|
|
check_value = row['CHECK VALUE']
|
|
|
|
direct = row['DIRECTION']
|
|
|
|
direct = row['DIRECTION']
|
|
|
|
check_distance = row['CHECK DISTANCE']
|
|
|
|
check_distance = row['CHECK DISTANCE']
|
|
|
|
polygon_name = row['POLYGON NAME']
|
|
|
|
shp_dir = row['SHP SWASH FOLDER']
|
|
|
|
path_2_poly = row['PATH TO POLYGON']
|
|
|
|
|
|
|
|
# temp_las4 = row['TEMP LAS4']
|
|
|
|
|
|
|
|
picture = row['PICTURE']
|
|
|
|
|
|
|
|
tmp_dir = row['TMP FOLDER']
|
|
|
|
tmp_dir = row['TMP FOLDER']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get base name of input las
|
|
|
|
|
|
|
|
las_basename = os.path.splitext(os.path.basename(input_las))[0]
|
|
|
|
|
|
|
|
|
|
|
|
# Crop to beach boundary
|
|
|
|
# Crop to beach boundary
|
|
|
|
print('Clipping...')
|
|
|
|
print('Clipping...')
|
|
|
|
las_data = call_lastools('lasclip', input=input_las1, output='-stdout',
|
|
|
|
las_data = call_lastools('lasclip', input=input_las, output='-stdout',
|
|
|
|
args=['-poly', initial_crop_poly], verbose=False)
|
|
|
|
args=['-poly', initial_crop_poly], verbose=False)
|
|
|
|
|
|
|
|
|
|
|
|
# Classify ground points
|
|
|
|
# Classify ground points
|
|
|
@ -388,13 +383,14 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# Interpolate point cloud onto a grid
|
|
|
|
# Interpolate point cloud onto a grid
|
|
|
|
print('Interpolating to grid...')
|
|
|
|
print('Interpolating to grid...')
|
|
|
|
call_lastools('las2dem', input=las_data, output=temp_xyz,
|
|
|
|
xyz_name = os.path.join(tmp_dir, las_basename + '.xyz')
|
|
|
|
|
|
|
|
call_lastools('las2dem', input=las_data, output=xyz_name,
|
|
|
|
args=['-step', 1], verbose=False)
|
|
|
|
args=['-step', 1], verbose=False)
|
|
|
|
|
|
|
|
|
|
|
|
# Make runup clipping mask
|
|
|
|
# Make runup clipping mask
|
|
|
|
print('Calculating runup clipping mask...')
|
|
|
|
print('Calculating runup clipping mask...')
|
|
|
|
shp_name = os.path.join(path_2_poly, polygon_name)
|
|
|
|
shp_name = os.path.join(shp_dir, las_basename + '.shp')
|
|
|
|
polygon_wave_runup(temp_xyz, direct, shp_name, check_value, check_distance, zone_MGA)
|
|
|
|
polygon_wave_runup(xyz_name, direct, shp_name, check_value, check_distance, zone_MGA)
|
|
|
|
#NOTE THAT YOU NEED TO CHECK THE OUTPUT SHP FILE AND ADJUST AS REQUIRED
|
|
|
|
#NOTE THAT YOU NEED TO CHECK THE OUTPUT SHP FILE AND ADJUST AS REQUIRED
|
|
|
|
|
|
|
|
|
|
|
|
#delete the temp files
|
|
|
|
#delete the temp files
|
|
|
|