#49: Your Software Thinks in Pixels, But Your Hard Drive Thinks in Blocks

Share

Most developers treat rasters as continuous grids of pixels. They’re not. They’re discrete chunks of compressed data. This distinction determines I/O cost and latency.

A block is the atomic unit of raster storage—a 512×512 or 256×256 square of pixels stored together and compressed as one unit. You cannot read a single pixel without fetching and decompressing the entire block containing it. That’s the constraint.

Compression algorithms (Deflate, ZSTD, LZW) work on blocks. Once you request a pixel, the decompressor inflates the whole block. The CPU cost is fixed per block, regardless of how many pixels you actually use. Read one pixel from a 512×512 block? Decompress all 262,144 pixels. That’s the trade-off.

Block sizing determines the latency-bandwidth curve. Small blocks (256×256) mean more HTTP requests to fill a screen—high latency, low per-request bandwidth. Large blocks (1024×1024) mean fewer requests—low latency, but you fetch wasted data if you only need a corner. 512×512 is the cloud standard: the compromise that runs the internet.

Edge artifacts: if your raster dimensions aren’t perfect multiples of block size, the final blocks contain padding (empty data). A 1025×1025 image needs a second row and column of blocks, mostly empty.

Local SSD processing can use 1024. Slow networks demand 256. The internet runs on 512.

The rule: Tune block size for the network, not the disk. Default to BLOCKSIZE=512. Compression is per-block; you pay the whole cost regardless of need.

Whenever you’re ready, here are 4 ways I can help you grow in GIS & spatial data:

​Spatial Lab​ – My private community where GIS professionals, data engineers, and analysts connect, swap workflows, and build repeatable systems together.

​Modern GIS Accelerator​ – A guided program to help you break out of legacy GIS habits and learn modern, scalable workflows.

​Career Compass​ – A career-focused program designed to help GIS pros navigate the job market, sharpen their pitch, and find roles beyond traditional GIS paths.

​Sponsorship​: Interested in sponsoring this newsletter (or other content)? ​Learn more here​ and fill out the form to get in touch!

48: A COG Is the Only Format Where 99% of the Data Is Irrelevant

Prev

50: PMTiles Turns a Directory of a Million Files Into a Single API

Next
Comments
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Get every update, in your inbox.
Get every update, in your inbox.
Get every update, in your inbox.
One tip, every day
Get every update, in your inbox.
Subscribe below and join 11,000+ others learning modern GIS.