Skip to content

feat: Add script to generate npy files from saved tiffs - #30

Merged
kylebarron merged 1 commit into
mainfrom
kyle/add-generate-npy-scripot
Feb 13, 2026
Merged

kylebarron merged 1 commit into
mainfrom
kyle/add-generate-npy-scripot

Conversation

@kylebarron

@kylebarron kylebarron commented Feb 13, 2026 •

Copy link
Copy Markdown
Member

This adds a script to generate .npy tile files alongside each TIFF in the repository.

This is intended to be used for downstream libraries to have "known" valid data to test
against, without needing to read TIFF files directly. I.e. in Python we can easily test
against rasterio at runtime, but in something like JavaScript, there's no canonical
known-good TIFF reader. So having .npy files (which are pretty easy to parse in any
language) allows us to test against a known reference implementation.

For each TIFF file, this script reads every internal tile (block) at each IFD
level (full resolution + overviews) and saves them as NumPy .npy files.

Output structure:
<tif_stem>/--.npy

where z=0 is full resolution, z=1 is the first overview, etc.
x is the column index and y is the row index of the tile.

The .npy array has shape (bands, height, width).

In particular, I want to use this to test data in @developmentseed/geotiff

@kylebarron
kylebarron merged commit 4f26883 into main Feb 13, 2026
1 check passed
@kylebarron
kylebarron deleted the kyle/add-generate-npy-scripot branch February 13, 2026 22:12
kylebarron added a commit to developmentseed/deck.gl-raster that referenced this pull request Mar 5, 2026
This PR adds integration tests with Rasterio.

Since rasterio is a Python library, we compare data indirectly via Numpy
NPY files. `geotiff-test-data` has a Pixi command named `generate-npy`
(developmentseed/geotiff-test-data#30) that
generates NPY files from the same source GeoTIFFs


Closes #267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant