A few lines before the ones you quoted from the script dstile is set to a raster in memory:
 dstile = self.mem_drv.Create('', self.tilesize, self.tilesize, tilebands)
This memory dataset driver defaults to a datatype of byte. You need to override this to the datatype of your choice. I'm not familiar enough with the Python interface to be able to tell you how to do that in Python, though.

On 9/20/2014 6:20 AM, Jan Tosovsky wrote:
Dear All,

I am trying to produce GeoTiff tiles from my SRTM based GeoTiff:

gdal2tiles.py -z 6-7 warped.tif D:\tiles-gdal

The problem is that the final data is somehow converted from 16bit into 8bit
so useless for intended further processing.

In the script there are following lines responsible for r/w operations:

data = "" ry, rxsize, rysize, wxsize, wysize,
band_list=list(range(1,self.dataBandsCount+1)))
dstile.WriteRaster(wx, wy, wxsize, wysize, data,
band_list=list(range(1,self.dataBandsCount+1)))

Just a naive idea, could this be somehow edited to get the proper result?

I believe there is a solution as all translate->merge->warp steps kept the
16bit intact.

Thanks, Jan

Win7/GDAL 1.10


_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev



_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to