#lidar #crs #header #enums

las-crs

Get the CRS from a las::Header

2 releases

new 0.1.1 May 8, 2025
0.1.0 May 8, 2025

#136 in Geospatial

MIT license

13KB
221 lines

Small library for getting the CRS from lidar files. Just pass a &las::Header to the parse_las_crs function


lib.rs:

Small library for getting the CRS from lidar files. Just pass a &las::Header to the parse_las_crs function

The library should be able to parse CRS's stored in WKT-CRS v1 and v2 and GeoTiff U16 (E)VLR(s)

The CRS is returend in a Result<Crs, CrsError> CRS has the fields horizontal, which is a u16 EPSG code, and vertical, which is an optional u16 EPSG code. Only horizontal CRS's are detected for WKT-CRS (E)VLRs Geotiff-CRS (E)VLRs might have both

The validity of the extracted code is not checked. Use the crs-definitions crate for checking validity of EPSG codes.

Be aware that certain software adds invalid CRS VLRs when writing CRS-less lidar files (f.ex when QGIS convert .la[s,z] files without a CRS-VLR to .copc.laz files). This is because the las 1.4 spec (which .copc.laz demands), requires a WKT-CRS (E)VLR to be present. These VLRs often contain the invalid EPSG code 0.

Userdefined CRS's and CRS's stored in GeoTiff string or Doubles data is not yet supported. The different Error's are described in the CrsError enum

Dependencies

~1.8–2.6MB
~46K SLoC