From c99f9dc77c09ca9322c7b4b57175bed7dddcd3f2 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 22 Feb 2019 15:28:37 -0500 Subject: [PATCH] Added --pc-las flag --- opendm/config.py | 7 ++++++- opendm/types.py | 2 ++ scripts/odm_georeferencing.py | 11 ++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/opendm/config.py b/opendm/config.py index 2963df6b..a1c0947a 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -300,7 +300,7 @@ def config(): metavar='', default='none', choices=['none', 'smrf', 'pmf'], - help='Classify the .LAS point cloud output using either ' + help='Classify the point cloud outputs using either ' 'a Simple Morphological Filter or a Progressive Morphological Filter. ' 'If --dtm is set this parameter defaults to smrf. ' 'You can control the behavior of both smrf and pmf by tweaking the --dem-* parameters. ' @@ -311,6 +311,11 @@ def config(): action='store_true', default=False, help='Export the georeferenced point cloud in CSV format. Default: %(default)s') + + parser.add_argument('--pc-las', + action='store_true', + default=False, + help='Export the georeferenced point cloud in LAS format. Default: %(default)s') parser.add_argument('--texturing-data-term', metavar='', diff --git a/opendm/types.py b/opendm/types.py index dc924e2e..269241a9 100644 --- a/opendm/types.py +++ b/opendm/types.py @@ -374,6 +374,8 @@ class ODM_Tree(object): self.odm_georeferencing, 'las.json') self.odm_georeferencing_model_laz = io.join_paths( self.odm_georeferencing, 'odm_georeferenced_model.laz') + self.odm_georeferencing_model_las = io.join_paths( + self.odm_georeferencing, 'odm_georeferenced_model.las') self.odm_georeferencing_dem = io.join_paths( self.odm_georeferencing, 'odm_georeferencing_model_dem.tif') diff --git a/scripts/odm_georeferencing.py b/scripts/odm_georeferencing.py index e36d0c40..59ffa09c 100644 --- a/scripts/odm_georeferencing.py +++ b/scripts/odm_georeferencing.py @@ -161,7 +161,16 @@ class ODMGeoreferencingCell(ecto.Cell): "--writers.text.keep_unspecified=false ".format( tree.odm_georeferencing_model_laz, tree.odm_georeferencing_xyz_file)) - + + # LAS point cloud output + if args.pc_las: + log.ODM_INFO("Creating geo-referenced LAS file") + + system.run("pdal translate -i \"{}\" " + "-o \"{}\" ".format( + tree.odm_georeferencing_model_laz, + tree.odm_georeferencing_model_las)) + if args.crop > 0: log.ODM_INFO("Calculating cropping area and generating bounds shapefile from point cloud") cropper = Cropper(tree.odm_georeferencing, 'odm_georeferenced_model')