2

I would like to convert a DEM raster NetCDF file (*.nc) to point cloud LAS file (LAS/LAZ) using Python language. I have been doing the research but still don't have a result. I also have a look on GDAL and PDAL, but there is no specific documents mentioning about this.

1 Answer 1

2

Check this out.

This solution works if you have your DEM as TIFF format. But if you can extract the XYZ coordinates from the NetCDF file yourself and save it to a text file, then you can use LAStools to create LAS file. although LAStools is a command line tool but you can use it in python:

def convert_txt_to_las(txt_path, out_las_path):
    command = 'txt2las -parse xyz -i {input_txt} -o {output_las}'
    os.system(command.format(input_txt=txt_path, output_las=out_las_path))
1
  • Hi Parsa! Thank you so so much for your help! I successfully made it :)). Yayyy!
    – Happier
    Aug 13, 2021 at 3:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.