From 7ad2760377b970bae8aabaf9df6a8514e6fe3804 Mon Sep 17 00:00:00 2001 From: Chris Drummond Date: Thu, 20 Feb 2020 13:01:24 +1100 Subject: [PATCH] Does not crop the classified las file --- las_outputs.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/las_outputs.py b/las_outputs.py index ad59e53..7b6c391 100644 --- a/las_outputs.py +++ b/las_outputs.py @@ -240,33 +240,11 @@ def process(yaml_file): # Get name of swash cropping polygon crop_swash_poly = os.path.join(shp_swash_dir, las_basename + '.shp') - # Crop point cloud to swash boundary - #print('Cropping swash...') - #las_data = call_lastools('lasclip', input=input_las, output='-stdout', - # args=['-poly', crop_swash_poly], verbose=False) - - # Export classified, clipped las for delivery to client - #las_name = os.path.join(output_las_dir, las_basename + '.las') - #with open (las_name, 'wb') as f: - # f.write(las_data) - - # Apply sea-side clipping polygon - print('Cropping back of beach...') - #las_data = call_lastools('lasclip', input=las_data, output='-stdout', - las_data = call_lastools('lasclip', input=input_las, output='-stdout', - args=['-poly', crop_heatmap_poly], verbose=False) - - - # Create clipping polygon for heatmap raster - print('Creating heat map cropping polygon...') - shp_name = os.path.join(output_poly_dir, las_basename + '.shp') - call_lastools('lasboundary', input=las_data, output=shp_name, verbose=False) - # Make a raster from point cloud print('Creating heat map raster...') tif_name = os.path.join(output_tif_dir, las_basename + '.tif') - call_lastools('blast2dem', input=las_data, output=tif_name, - args=['-step', 0.1, '-keep_class', 2], verbose=False) + call_lastools('blast2dem', input=input_las, output=tif_name, + args=['-step', 0.1, '-keep_class', 2], verbose=True) # IF THIS STEP ISN'T WORKING: # might mean there are no data lines # trying running with args=['-step', 1, '-keep_class', 2, '-rescale', 0.001,0.001,0.001] @@ -276,7 +254,7 @@ def process(yaml_file): # Extract elevations along profiles from triangulated surface print('Extracting profile elevations...') df = extract_pts( - las_data, + input_las, cp_csv, survey_date, beach,