The LAS .NET library is a comprehensive, high-performance library for reading and writing ASPRS LAS LiDAR point cloud files. It supports LAS versions 1.1-1.5 and provides a modular package structure with extensions for various formats and cloud platforms.
- High Performance: Low-allocation types for efficient point cloud processing
- Multiple LAS Versions: Full support for LAS 1.1 through 1.5
- Compression: Support for LAZ compression
- Cloud Integration: Read/write from Azure Blob Storage, Amazon S3, and HTTP(S) endpoints
- Arrow Integration: Read/write to Apache Arrow format
- DataFrame Support: Integration with Polars DataFrames
- Geodesy Support: OGC WKT coordinate system support via PROJ
- Indexing: Spatial indexing for fast point access
- Tiling Support: Read tiling VLRs from LAS files
- AOT Compatible: Ready for Native AOT compilation
The las command-line tool is available as a Native AOT-compiled executable and container. It provides a comprehensive interface for working with LAS files.
dotnet tool install --global Lasdocker run ghcr.io/altemiq/io/las# Show help
las --help
# Show file info
las info input.las
# Create spatial index
las index input.las
# Verify COPC file
las copc verify input.copc.laz
# Convert to LAS
las to las --input input.las --output output.las
# Convert to LAZ
las to laz --input input.las --output output.laz
# Convert to COPC (Cloud Optimized Point Cloud)
las to copc --input input.las --output output.copc.laz
# Sort points
las to sorted --input input.las --output output.las
# Split file into parts
las to exploded --input input.las --output output/using Altemiq.IO.Las;
using LasReader reader = new("example.las");
while (await reader.ReadPointDataRecordAsync() is { PointDataRecord: not null } point)
{
Console.WriteLine($"Point: {point.X}, {point.Y}, {point.Z}");
}using Altemiq.IO.Las;
HeaderBlockBuilder builder = new()
{
SystemIdentifier = "My System",
GeneratingSoftware = "My.Software.exe",
Version = new(1, 1),
PointDataFormatId = 1,
LegacyNumberOfPointRecords = 1,
};
using LasWriter writer = new("example.las");
writer.Write(builder.HeaderBlock, geoKeyDirectoryTag, extraBytes);using Altemiq.IO.Las;
using LazReader reader = new("example.laz");
while (await reader.ReadPointDataRecordAsync() is { PointDataRecord: not null } point)
{
Console.WriteLine($"Point: {point.X}, {point.Y}, {point.Z}");
}using Altemiq.IO.Las;
using Altemiq.IO.Las.S3;
var url = new Uri("s3://bucket/path/file.las");
LasReader reader = new(S3Las.OpenRead(url));using Altemiq.IO.Las;
using LasReader reader = new("example.las");
var batches = reader.ToArrowBatches();
ArrowLasReader arrowReader = new(batches);using Altemiq.IO.Las;
using LasReader reader = new("example.las");
var data = Polars.CSharp.DataFrame.ReadLas(reader);# Restore dependencies
dotnet restore
# Build
dotnet build
# Run tests
dotnet test
# Package
dotnet pack- .NET 10.0 (latest)
- .NET 9.0
- .NET 8.0
- .NET 7.0
- .NET Standard 2.1
- .NET Standard 2.0
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution.
This project is licensed under the MIT License. See the LICENSE file for details.
- ASPRS for the LAS specification
- LAStools for LAZ compression library
- Apache Arrow for the columnar format
- PROJ for coordinate system transformations