You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Raster commands process a large raster in pieces instead of reading it whole #2865
Commands that make a raster (Raster Functions, Indices, Classification, Change Detection, Process, Suitability, Viewshed, Deep Learning) and the geoprocessing tools read their whole input before they work, then build their whole output. Since #2772 and #2862, a large local tiled GeoTIFF is read at the finest level that fits memory. For the 83517 × 78739 mosaic in #2761, that's the 1:8 level, 10439 × 9842. An NDVI over it takes 5.9 s and peaks at 1.8 GB:
1.23 GB of input
0.41 GB of output
the output's GeoTIFF bytes
The full-resolution image doesn't fit at all.
Most of these work cell by cell or over a small neighbourhood: band math, remaps, thresholds, classification by known means, clip and resample. They could read the input a block of tiles at a time and write each block of output as it's made. Peak memory would then be a few blocks, and the full-resolution image would be within reach.
What it takes:
A windowed read in the GeoTIFF reader: the pixels of one area at one level. Clip by extent needs this alone too; it now reads the whole level and then clips.
A block-wise path for the per-cell commands, with output written block by block (to a tiled GeoTIFF on disk rather than embedded bytes once it's large).
Commands that need the whole raster stay as they are: k-means, viewshed, and statistics that need every value. They read the finest level that fits, and say so.
Activity
feat(raster): Indices over a large tiled GeoTIFF run a block at a tim…
feat(raster): Clip by extent reads only its part of a large tiled Geo…
feat(raster): Indices over a large tiled GeoTIFF run a block at a tim…
feat(raster): Indices over a large tiled GeoTIFF run a block at a tim…
feat(raster): Raster Functions, the Function Editor and resample work…
feat(raster): Raster Functions, the Function Editor and resample work…
fix(raster): review fixes for raster functions and resample in blocks (…
feat(raster): Classification Tools work a block at a time on a large …
feat(raster): Raster Functions, the Function Editor and resample work…
feat(raster): Classification Tools work a block at a time on a large …
feat(raster): Classification Tools work a block at a time on a large …
feat(raster): a resample too large to hold is written to a file a blo…
fix(raster): a streamed overview's alpha is kept whatever mean it com…
feat(raster): a resample too large to hold is written to a file a blo…