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

Helper to write SRS as WKT in VLR format #31

Closed RomainLaporte closed 3 years ago

RomainLaporte commented 3 years ago

Hi, First, thank you for this very helpful library. Is there any way to easily write the SRS in WKT format when creating a las file with pylas.create() ? I see there is a write_to() method from the pylas.vlrs.vlrlist module but I do not understand how it works. Maybe an example can help here. Thanks.

tmontaigu commented 3 years ago

Hello you shoud be able to add a a Wkt a VLR to a las object by doing:

>>> import pylas
>>> las = pylas.create()
>>> wkt_vlr = pylas.vlrs.known.WktCoordinateSystemVlr(some_wkt_str)
>>> las.vlrs.append(wkt_vlr)
>>> las.write("test.las") # The resulting las should have the wkt saved

However this is defined only for LAS version >= 1.4

RomainLaporte commented 3 years ago

Thank you, that's exactly what I was looking for !