Last active
September 11, 2023 18:49
-
-
Save wburt/f0c5a91cc5c30a1c8719adde7ba951d0 to your computer and use it in GitHub Desktop.
Python fix for error "Global encoding WKT flag not set for point format 6 - 10." encountered when reading las files with PDAL and QGIS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Fixes error | |
Global encoding WKT flag not set for point format 6 - 10. | |
encountered when reading las files with PDAL and QGIS | |
first parameter is laz/las file needing fix | |
note: can also override the input crs if it is known | |
https://gis.stackexchange.com/questions/413191/python-pdal-error-reading-format-1-4-las-file-readers-las-error-global-enco | |
usage: | |
python -m fix_bc_laz_with_pdal myfile.laz | |
""" | |
import sys | |
filename = sys.argv[1] | |
with open(filename, "rb+") as f: | |
f.seek(6) | |
f.write(bytes([17, 0, 0, 0])) | |
print (f"Fixed:{filename}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment