Code & tools

ASCII XYZ LiDAR Metadata

Before using an elevation tile in GIS, I want to know what area it covers and what values it contains. I wrote this reader for an ASCII XYZ file derived from a LiDAR elevation model. It reports the point count, coordinate extents, tile dimensions and minimum, maximum and mean elevation in a text summary.

Input
Easting, northing and elevation
Output
Text metadata summary
Tools
Python, ASCII XYZ, LiDAR elevation data

Inspecting the file one row at a time

Each row contains an easting, northing and elevation. As I read the file, I update a running count, elevation total and the smallest and largest coordinate and elevation values. The script does not need to retain every point in memory.

At the end, I calculate the mean elevation and derive the tile width and height from its coordinate ranges. This approach suits a large text file when the immediate need is a basic description rather than a detailed display of every point.

Using the metadata summary

The extents help check whether the tile covers the expected location, while the dimensions and elevation range provide a quick comparison with the source description or neighbouring tiles. An unexpected value gives me something specific to investigate before continuing the analysis.

The file must contain three numeric values per row, and horizontal coordinates must be in metres for the reported dimensions to have the intended meaning. The summary does not establish the coordinate reference system, assess elevation accuracy or describe gaps within the tile. It is a format specific inspection step, not a point classification or LAS processing tool.

Data and references

Get in touch

I’m looking for GIS opportunities across Canada. You can reach me by email or on LinkedIn.