Lasmerge - how are you doing?

I am doing a rather big processing job. It is above 4.000 images, so I am using the following options:

fast-orthophoto: true, split: 300, split-overlap: 15

Log says it’s been running lasmerge for some 13 hours now. This could very well be the case. One logical core is at 100%, and the docker instance says it is working.

[INFO] Running merge stage
[INFO] running lasmerge -i /var/www/data/05f7b780-fada-4602-a77c-cb8f3d5e00f0/submodels/submodel_0008/odm_georeferencing/odm_georeferenced_model.laz /var/www/data/05f7b780-fad [etc…]

Are there any ways of getting information to the log on the progress of this task? Could webodm (nodeodm) run lasmerge it with the “verbose” option? If so, how?

2 Likes

I don’t think there’s a way to currently add the verbose flag.

We could add it here though: https://github.com/OpenDroneMap/ODM/blob/ef174de8af8dbb87379fa882f20ede34c751aef1/opendm/point_cloud.py#L235

(open a pull request?)

3 Likes

I’m thinking it should be linked to the global verbose (in the job settings). I would rather not mess around with the code without knowing it. The merge function should take -verbose as an argument. So this is where it starts:

def merge(input_point_cloud_files, output_file, rerun=False)

Took the function and drafted some changes. Not able to check the code, my string handling is not good and lastly python is not my first language. But something like this could solve it:

def merge(input_point_cloud_files, output_file, rerun=False, verbose):
num_files = len(input_point_cloud_files)

if verbose == True:
    local_verbose = " -verbose"
elif:
    local_verbose = ""

if num_files == 0:
    log.ODM_WARNING("No input point cloud files to process")

if io.file_exists(output_file):
    log.ODM_WARNING("Removing previous point cloud: %s" % output_file)
    os.remove(output_file)

kwargs = {
    'all_inputs': " ".join(map(quote, input_point_cloud_files)),
    'output': output_file
}

system.run('lasmerge -i {all_inputs} -o "{output}"'.format(**kwargs)).local_verbose
1 Like

So it turned out it was not lasmerge which held up all this time, but rather merge in orthophoto.py.

The same challenge goes for merge.py. Once the job I am doing has concluded I will look at the code and try to rewrite it somewhat so that we get some more info (log.ODM_INFO) on the progress of the merge process. As a minimum it should be flagging which submodel it is processing, perhaps like this:

[INFO] Processing submodel 1 of 13 Mon Nov 16 02:59:01 2020
[INFO] Processing submodel 2 of 13 Mon Nov 16 04:59:01 2020
etc

3 Likes

Will your change also print the info out to the terminal?

1 Like

Yes - the goal is to add some code to print to the terminal (“Task output”). Hope to have time to play around enough to do a pull request.

3 Likes