diff --git a/myria3d/pctl/dataset/utils.py b/myria3d/pctl/dataset/utils.py index 7e6b7370..cde32285 100644 --- a/myria3d/pctl/dataset/utils.py +++ b/myria3d/pctl/dataset/utils.py @@ -96,13 +96,12 @@ def get_pdal_reader(las_path: str, epsg: str) -> pdal.Reader.las: # get_metadata(las_path)['metadata']['readers.las']['srs']['compoundwkt']: # # read the lidar file with pdal default # return pdal.Reader.las(filename=las_path) - if 'metadata' in get_metadata(las_path): - if 'readers.las' in get_metadata(las_path)['metadata']: - if 'srs' in get_metadata(las_path)['metadata']['readers.las']: - if 'compoundwkt' in get_metadata(las_path)['metadata']['readers.las']['srs']: - if get_metadata(las_path)['metadata']['readers.las']['srs']['compoundwkt']: - # read the lidar file with pdal default - return pdal.Reader.las(filename=las_path) + try : + if get_metadata(las_path)['metadata']['readers.las']['srs']['compoundwkt']: + # read the lidar file with pdal default + return pdal.Reader.las(filename=las_path) + except: + pass # we will go to the "raise exception" anyway raise Exception("No EPSG provided, neither in the lidar file or as parameter")