[gdal-dev] gdal2tiles crashes on some rasters

Alexander Bruy alexander.bruy at gmail.com
Wed Dec 14 14:03:48 EST 2011


Hi all,

I have troubles using gdal2tiles. When I try to generate tiles from raster
it fails with error

Generating Base Tiles:
ERROR 5: Illegal values for buffer size
ERROR 5: Illegal values for buffer size
Traceback (most recent call last):
  File "/usr/bin/gdal2tiles.py", line 2241, in <module>
    gdal2tiles.process()
  File "/usr/bin/gdal2tiles.py", line 478, in process
    self.generate_base_tiles()
  File "/usr/bin/gdal2tiles.py", line 1276, in generate_base_tiles
    dsquery.WriteRaster(wx, wy, wxsize, wysize, data,
band_list=list(range(1,self.dataBandsCount+1)))
  File "/usr/lib/python2.6/site-packages/GDAL-1.8.1-py2.6-linux-i686.egg/osgeo/gdal.py",
line 746, in WriteRaster
    buf_pixel_space, buf_line_space, buf_band_space )
TypeError: not a string

Here is my command
gdal2tiles.py -z '8-14' --srcnodata=0 merc_SHL_tmv.tif ./output

gdalinfo reports that raster georeferenced

Coordinate System is:
PROJCS["WGS 84 / UTM zone 54N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",141],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32654"]]

When I set input CRS in gdal2tiles command and try again same error appears.
Also I try to warp input raster to Google Mercator using this command

gdalwarp -t_srs '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs' SHL_tmv.tif
merc_SHL_tmv.tif

and generate tiles from reprojected image. Same result.
But for some other raster after reprojecting with same command gdal2tiles works.
Any ideas what is wrong?

Thanks
-- 
Alexander Bruy


More information about the gdal-dev mailing list