Fix to prevent negative size values in gdal2tiles.py#14101
Fix to prevent negative size values in gdal2tiles.py#14101antonmyagotin wants to merge 1 commit intoOSGeo:masterfrom
Conversation
for big geotiff files the tiling craches due to negative values in rxsize, rysize, wxsize, wysize. We just skip the inopropriate tile sizes.
|
@antonmyagotin https://gis.stackexchange.com/questions/249809/gdal2tiles-error-5-illegal-values-for-buffer-size-error-for-a-single-zoom-lev is about size = 0. Do you have a reproducer with negative sizes ? |
|
yes, for several big geotiffs I can reproduce the crash |
Please use "gdal_create" with options "-co TILED=YES -co SPARSE_OK=YES" to create an empty file with the same characteristics, and attach it there (zipped), and also the exact gdal2tiles command line you use |
|
Sorry for the delay, it took some time to generate smallest reproducable example small_sample.zip create original vrt filegdalbuildvrt -input_file_list filelist.txt original.vrt create scaled vrtgdal_translate -of VRT -ot Byte -a_nodata 0 -scale -15 15 1 255 original.vrt scaled.vrt and finally generate tilesgdal2tiles --processes 8 --tilesize=256 --tiledrive=PNG scaled.vrt it gives an error: Traceback (most recent call last): Checking out actual values for rxsize, rysize, wxsize, wysize I see that they are negative. |
|
It seems to work well with the new alternative https://gdal.org/en/stable/programs/gdal_raster_tile.html |
…uare pixels that can cause exceptions due to empty tiles being attempted to be generated, or tiles that should be generated not being generated Fixes OSGeo#14101
|
closing this PR as it only fixes the symptom and not the root cause. Proper fix in #14115 |
…uare pixels that can cause exceptions due to empty tiles being attempted to be generated, or tiles that should be generated not being generated Fixes OSGeo#14101
…uare pixels that can cause exceptions due to empty tiles being attempted to be generated, or tiles that should be generated not being generated Fixes #14101
Problem:
Gdal2tiles crashes with the message "Illegal values for buffer size". The problem was reported in multiple source and exists already for years. Examples:
https://gis.stackexchange.com/questions/249809/gdal2tiles-error-5-illegal-values-for-buffer-size-error-for-a-single-zoom-lev
Solution:
We just skip the tile with negative extent values.