Re: [gdal-dev] gdal2tiles for 16bit data

2014-09-29 Thread Jan Tosovsky
On 2014-09-23 David Strip wrote: > On 9/22/2014 2:18 PM, Jan Tosovsky wrote: > > On 2014-09-21 David Strip wrote: > > > > > > If this still doesn't fix it, the first thing to do is run gdalinfo > > > against one of the tiles and let us know the result. > > > > Thanks for the hint. I've checked the

Re: [gdal-dev] gdal2tiles for 16bit data

2014-09-22 Thread David Strip
On 9/22/2014 2:18 PM, Jan Tosovsky wrote: > On 2014-09-21 David Strip wrote: >> Looking back at the code, the actual output file is created with >> this line: >> self.out_drv.CreateCopy(tilefilename, dstile, strict=0) > Hmm, I have no idea how to pass this info into CreateCopy: > http://www.gdal.o

Re: [gdal-dev] gdal2tiles for 16bit data

2014-09-22 Thread Jan Tosovsky
On 2014-09-21 David Strip wrote: > On 9/20/2014 9:02 AM, Jan Tosovsky wrote: > > > Adding an extra parameter seems to be fixing this: > > dstile = self.mem_drv.Create('', self.tilesize, self.tilesize, > > tilebands, gdal.GDT_UInt16) > > (applied to all 'mem_drv.Create' occurrences) > > > > But the

Re: [gdal-dev] gdal2tiles for 16bit data

2014-09-20 Thread David Strip
On 9/20/2014 9:02 AM, Jan Tosovsky wrote: But the final tif has most likely incorrect metadata as its reading via jai-imageio fails ArrayIndexOutOfBoundsException: 256 (Despite the Ok result when reading the tiling source image using the same method) Any idea? Th

Re: [gdal-dev] gdal2tiles for 16bit data

2014-09-20 Thread Jan Tosovsky
On 2014-09-20 David Strip wrote: > > On 9/20/2014 6:20 AM, Jan Tosovsky wrote: > > > > 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 usele

Re: [gdal-dev] gdal2tiles for 16bit data

2014-09-20 Thread David Strip
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 da

[gdal-dev] gdal2tiles for 16bit data

2014-09-20 Thread Jan Tosovsky
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 f