Skip to content

Commit

Permalink
add the possibility to pass an epsg as a number,
Browse files Browse the repository at this point in the history
or a string describing the srs (EPSG:2154 for
example)
  • Loading branch information
MichelDaab authored and leavauchier committed Dec 13, 2023
1 parent 9b02de2 commit b1d273b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions myria3d/pctl/dataset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,20 @@ def get_pdal_reader(las_path: str, epsg: str) -> pdal.Reader.las:

if epsg :
# if an epsg in provided, force pdal to read the lidar file with it
return pdal.Reader.las(
filename=las_path,
nosrs=True,
override_srs=f"EPSG:{epsg}",
)
try :
int(epsg)
return pdal.Reader.las(
filename=las_path,
nosrs=True,
override_srs=f"EPSG:{epsg}",
)
except ValueError:
return pdal.Reader.las(
filename=las_path,
nosrs=True,
override_srs=epsg,
)


# if 'srs' in get_metadata(las_path)['metadata']['readers.las'] and \
# 'compoundwkt' in get_metadata(las_path)['metadata']['readers.las']['srs'] and \
Expand Down

0 comments on commit b1d273b

Please sign in to comment.