LAS
application/x-asprs
Magic Bytes
Offset: 0
4C 41 53 46
The LAS file format is a public standard for the interchange of 3-dimensional point cloud data, maintained by the American Society for Photogrammetry and Remote Sensing (ASPRS). It serves as an industry-standard binary format for storing airborne and terrestrial LiDAR data used in topographic mapping, urban planning, and forestry applications. As a binary container for coordinate data without executable code capabilities, the format presents minimal security risks and focuses on efficient storage.
Validation Code
How to validate .las files in Python
Python
def is_las(file_path: str) -> bool:
"""Check if file is a valid LAS by magic bytes."""
signature = bytes([0x4C, 0x41, 0x53, 0x46])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .las files in Node.js
Node.js
function isLAS(buffer: Buffer): boolean {
const signature = Buffer.from([0x4C, 0x41, 0x53, 0x46]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsLAS(data []byte) bool {
signature := []byte{0x4C, 0x41, 0x53, 0x46}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/las
curl https://filesignature.org/api/v1/las