tmontaigu / pylas

⚠️ pylas was merged into laspy 2.0 https://github.com/laspy/laspy⚠️
BSD 3-Clause "New" or "Revised" License
39 stars 13 forks source link

Uppercase extensions #14

Closed fnattino closed 4 years ago

fnattino commented 4 years ago

Hi! I am using pylas for reading and writing LAS and LAZ files, it is really a great tool! Just wanted to mention that while files with both upper- and lower-case extensions (e.g. 'file.laz' and 'file.LAZ') are properly recognised as compressed files in reading, this is not the case in writing: writing to 'file.laz' would generate a compressed file, while 'file.LAZ' would not be compressed. Maybe having filename.split(".").lower()[-1] == "laz" here? https://github.com/tmontaigu/pylas/blob/1255266c36a48f2469b28449a85c19f1c754b7b5/pylas/lasdatas/base.py#L327

tmontaigu commented 4 years ago

Hello,

Actually the file extension is not used when reading to know if the file is compressed or not. That said, not compressing file.LAZis bad, and I agree with your suggestion of adding a lower() call