[gdal-dev] gdal_rasterize processed GTiff filesize question

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Tue Mar 19 06:25:44 PDT 2024


Hi,

So the target files dem.tif and hillshade.tif exist already? Maybe it is not so simple to update already compressed data in place. Have you tried what happens if you re-write the results into new files

gdal_translate -co tiled=yes -co compress=LZW hillshade.tif final_hillshade.tif.

-Jukka Rahkonen-

Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta Andrey VI via gdal-dev
Lähetetty: tiistai 19. maaliskuuta 2024 14.43
Vastaanottaja: gdal-dev at lists.osgeo.org
Aihe: [gdal-dev] gdal_rasterize processed GTiff filesize question

Hello.

I’m using gdal_rasterize to remove some data from DEM (Int16) and hillshade (Byte) rasters with shape-file, like this:
gdal_rasterize -burn -32768 shape.shp dem.tif and gdal_rasterize -burn 0 shape.shp hillshade.tif
Both DEM and hillshade GTiffs created with -co COMPRESS=LZW -co TILED=YES options. After processing with gdal_rasterize the size of GTiffs becomes 1.5 times larger. Why it happens? I assumed that it should be the other way around, because a significant portion of the data is replaced with the same values and should be compressed well.

Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240319/3024a52f/attachment.htm>


More information about the gdal-dev mailing list