From 516c9b9b692b60492a56c3fb3e47156ce192ed12 Mon Sep 17 00:00:00 2001 From: Rdataflow Date: Wed, 8 Jan 2025 17:59:42 +0100 Subject: [PATCH] ci: add tests for zstd --- test/data/setup_data.sh | 2 ++ test/geotiff.spec.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/test/data/setup_data.sh b/test/data/setup_data.sh index 29fdc2d4..55f77994 100755 --- a/test/data/setup_data.sh +++ b/test/data/setup_data.sh @@ -26,10 +26,12 @@ gdal_translate -of GTiff -co COMPRESS=LERC -co MAX_Z_ERROR=1000 stripped.tiff le gdal_translate -of GTiff -co COMPRESS=LERC -co MAX_Z_ERROR=1000 -co INTERLEAVE=BAND stripped.tiff lerc_interleave.tiff gdal_translate -of GTiff -co COMPRESS=LERC_DEFLATE -co MAX_Z_ERROR=1000 stripped.tiff lerc_deflate.tiff gdal_translate -of GTiff -co COMPRESS=LERC_ZSTD -co MAX_Z_ERROR=1000 stripped.tiff lerc_zstd.tiff +gdal_translate -of GTiff -co COMPRESS=ZSTD stripped.tiff zstd.tiff gdal_translate -of GTiff -ot Float32 -co COMPRESS=LERC -co MAX_Z_ERROR=1000 stripped.tiff float32lerc.tiff gdal_translate -of GTiff -ot Float32 -co COMPRESS=LERC -co MAX_Z_ERROR=1000 -co INTERLEAVE=BAND stripped.tiff float32lerc_interleave.tiff gdal_translate -of GTiff -ot Float32 -co COMPRESS=LERC_DEFLATE -co MAX_Z_ERROR=1000 stripped.tiff float32lerc_deflate.tiff gdal_translate -of GTiff -ot Float32 -co COMPRESS=LERC_ZSTD -co MAX_Z_ERROR=1000 stripped.tiff float32lerc_zstd.tiff +gdal_translate -of GTiff -ot Float32 -co COMPRESS=ZSTD stripped.tiff float32zstd.tiff gdal_translate -of COG initial.tiff cog.tiff diff --git a/test/geotiff.spec.js b/test/geotiff.spec.js index ad6e2829..9b529f0b 100644 --- a/test/geotiff.spec.js +++ b/test/geotiff.spec.js @@ -248,6 +248,11 @@ describe('GeoTIFF', () => { await performTiffTests(tiff, 539, 448, 15, Uint16Array); }); + it('should work on Zstandard compressed tiffs', async () => { + const tiff = await GeoTIFF.fromSource(createSource('zstd.tiff')); + await performTiffTests(tiff, 539, 448, 15, Uint16Array); + }); + it('should work on Float32 and LERC compressed tiffs', async () => { const tiff = await GeoTIFF.fromSource(createSource('float32lerc.tiff')); await performTiffTests(tiff, 539, 448, 15, Float32Array); @@ -268,6 +273,11 @@ describe('GeoTIFF', () => { await performTiffTests(tiff, 539, 448, 15, Float32Array); }); + it('should work on Float32 and Zstandard compressed tiffs', async () => { + const tiff = await GeoTIFF.fromSource(createSource('float32zstd.tiff')); + await performTiffTests(tiff, 539, 448, 15, Float32Array); + }); + it('should work with worker pool', async () => { const testPool = new Pool(); const tiff = await GeoTIFF.fromSource(createSource('nasa_raster.tiff'));