A Go library for parsing, reading, and converting ASPRS LAS 1.4 LiDAR point cloud files.
- Full support for LAS 1.1–1.4 public header, VLRs, EVLRs, and all point formats (0–10)
- CSV export of point data
- Extensible for custom VLRs/EVLRs
- Written in pure Go, no C dependencies
go get github.com/dalir/laspackage main
import (
"github.com/dalir/las"
"log"
)
func main() {
lasFile := las.Las{}
if err := lasFile.Parse("./pointcloud.las"); err != nil {
log.Fatalf("error parsing LAS file: %v", err)
}
if err := lasFile.Las2txt("./pointcloud.txt"); err != nil {
log.Fatalf("error converting to txt: %v", err)
}
}Parse(filename string) error: Parse a LAS file (header, VLRs, points, EVLRs)ParseHeader(filename string) error: Parse only the LAS headerLas2txt(outputFile string) error: Export point data to CSVWriteHeader(filename string) error: Write the current header to a file
See GoDoc for full API details.
Pull requests and issues are welcome! Please add tests for new features or bugfixes.
MIT