Skip to main content

Esri ASCII Grid Format

Stream Esri ASCII Grid rasters as cell or row records without loading the full grid first.

Overview

PropertyValue
Format idasc (aliases ascii-grid, asciigrid)
ClassASCIIGridIterable
Extensions.asc
ReadYes
WriteYes (cell mode)
Extranone

Modes

  • cell (default): one record per cell with row, col, x, y, value (nodata skipped).
  • row: one record per grid row with row and values (includes nodata markers).
from iterable import open_iterable

with open_iterable("dem.asc") as source:
for cell in source:
print(cell["x"], cell["y"], cell["value"])

with open_iterable("dem.asc", iterableargs={"mode": "row"}) as source:
for row in source:
print(row["row"], len(row["values"]))

See also