Gdal2tiles issue when using -z for specifying zoom lvls in raster profile

المشرف العام

Administrator
طاقم الإدارة
Everything works fine when not using -z. But using -z and only wanting 0-1, i run into an issue that is best illustrated as below.

C:\python\WinPython-64bit-2.7.6.4-gdal\python-2.7.6.amd64>python gdal2tiles.py -v -p raster -z 0-1 "/vsicurl/http://ascendworkerweu.blob.core.windows.net/shares/image.JPG" out('Options:', )('Input:', '/vsicurl/http://ascendworkerweu.blob.core.windows.net/shares/image.JPG')('Output:', 'C:\\dev\\stockpile_ground1')Cache: 40 MB('Input file:', '( 4608P x 3456L - 3 bands)')NODATA: []('Preprocessed file:', '( 4608P x 3456L - 3 bands)')('Bounds (output srs):', 0.0, -3456.0, 4608.0, 0.0)('Native zoom of the raster:', 5)Generating Base Tiles:Tiles generated from the max zoom level:----------------------------------------('dataBandsCount: ', 3)('tilebands: ', 4)(1, '/', 2, 'C:\\dev\\stockpile_ground1\\1\\0\\0.png')('\tReadRaster Extent: ', (0, 0, 4096, 3456), (0, 40, 256, 216))(2, '/', 2, 'C:\\dev\\stockpile_ground1\\1\\1\\0.png')('\tReadRaster Extent: ', (4096, 0, 512, 3456), (0, 40, 32, 216))Generating Overview Tiles:(1, '/', 1, 'C:\\dev\\stockpile_ground1\\0\\0\\0.png')('\tbuild from zoom', 1, ' tiles:', (0, 0), (1, 0), (0, 1), (1, 1))




It seems to be cutting out the correct extend from original, but it scales it wrong in the output images.

Is this intended, or can it only be used to generate lower lvl tiles when the base layer has been generated?

Update

Running with -z 4 on this jpeg, i can see that it tries to put the correct extend into the tile, but somehow def scale_query_to_tile(self, dsquery, dstile, tilefilename=''): is ending up resizing it from cliped out to the tile and then inside the tile also.

This produces same images as before, where it looks like the data is resized down to 1/16 of the tile:


('Options:', )('Input:', '/vsicurl/http://ascendworkerweu.blob.core.windows.net/shares/image.JPG')('Output:', 'C:\\dev\\stockpile_ground1')Cache: 40 MB('Input file:', '( 4608P x 3456L - 3 bands)')NODATA: []('Preprocessed file:', '( 4608P x 3456L - 3 bands)')('Bounds (output srs):', 0.0, -3456.0, 4608.0, 0.0)('Native zoom of the raster:', 5)Generating Base Tiles:Tiles generated from the max zoom level:----------------------------------------('dataBandsCount: ', 3)('tilebands: ', 4)(1, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\0\\6.png')('\tReadRaster Extent: ', (0, 0, 512, 384), (0, 64, 256, 192))(2, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\1\\6.png')('\tReadRaster Extent: ', (512, 0, 512, 384), (0, 64, 256, 192))(3, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\2\\6.png')('\tReadRaster Extent: ', (1024, 0, 512, 384), (0, 64, 256, 192))(4, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\3\\6.png')('\tReadRaster Extent: ', (1536, 0, 512, 384), (0, 64, 256, 192))(5, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\4\\6.png')('\tReadRaster Extent: ', (2048, 0, 512, 384), (0, 64, 256, 192))(6, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\5\\6.png')('\tReadRaster Extent: ', (2560, 0, 512, 384), (0, 64, 256, 192))(7, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\6\\6.png')('\tReadRaster Extent: ', (3072, 0, 512, 384), (0, 64, 256, 192))(8, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\7\\6.png')('\tReadRaster Extent: ', (3584, 0, 512, 384), (0, 64, 256, 192))(9, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\8\\6.png')('\tReadRaster Extent: ', (4096, 0, 512, 384), (0, 64, 256, 192))(10, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\0\\5.png')('\tReadRaster Extent: ', (0, 384, 512, 512), (0, 0, 256, 256))(11, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\1\\5.png')('\tReadRaster Extent: ', (512, 384, 512, 512), (0, 0, 256, 256))(12, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\2\\5.png')('\tReadRaster Extent: ', (1024, 384, 512, 512), (0, 0, 256, 256))(13, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\3\\5.png')('\tReadRaster Extent: ', (1536, 384, 512, 512), (0, 0, 256, 256))(14, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\4\\5.png')('\tReadRaster Extent: ', (2048, 384, 512, 512), (0, 0, 256, 256))(15, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\5\\5.png')('\tReadRaster Extent: ', (2560, 384, 512, 512), (0, 0, 256, 256))(16, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\6\\5.png')('\tReadRaster Extent: ', (3072, 384, 512, 512), (0, 0, 256, 256))(17, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\7\\5.png')('\tReadRaster Extent: ', (3584, 384, 512, 512), (0, 0, 256, 256))(18, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\8\\5.png')('\tReadRaster Extent: ', (4096, 384, 512, 512), (0, 0, 256, 256))(19, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\0\\4.png')('\tReadRaster Extent: ', (0, 896, 512, 512), (0, 0, 256, 256))(20, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\1\\4.png')('\tReadRaster Extent: ', (512, 896, 512, 512), (0, 0, 256, 256))(21, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\2\\4.png')('\tReadRaster Extent: ', (1024, 896, 512, 512), (0, 0, 256, 256))(22, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\3\\4.png')('\tReadRaster Extent: ', (1536, 896, 512, 512), (0, 0, 256, 256))(23, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\4\\4.png')('\tReadRaster Extent: ', (2048, 896, 512, 512), (0, 0, 256, 256))(24, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\5\\4.png')('\tReadRaster Extent: ', (2560, 896, 512, 512), (0, 0, 256, 256))(25, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\6\\4.png')('\tReadRaster Extent: ', (3072, 896, 512, 512), (0, 0, 256, 256))(26, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\7\\4.png')('\tReadRaster Extent: ', (3584, 896, 512, 512), (0, 0, 256, 256))(27, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\8\\4.png')('\tReadRaster Extent: ', (4096, 896, 512, 512), (0, 0, 256, 256))(28, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\0\\3.png')('\tReadRaster Extent: ', (0, 1408, 512, 512), (0, 0, 256, 256))(29, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\1\\3.png')('\tReadRaster Extent: ', (512, 1408, 512, 512), (0, 0, 256, 256))(30, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\2\\3.png')('\tReadRaster Extent: ', (1024, 1408, 512, 512), (0, 0, 256, 256))(31, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\3\\3.png')('\tReadRaster Extent: ', (1536, 1408, 512, 512), (0, 0, 256, 256))(32, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\4\\3.png')('\tReadRaster Extent: ', (2048, 1408, 512, 512), (0, 0, 256, 256))(33, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\5\\3.png')('\tReadRaster Extent: ', (2560, 1408, 512, 512), (0, 0, 256, 256))(34, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\6\\3.png')('\tReadRaster Extent: ', (3072, 1408, 512, 512), (0, 0, 256, 256))(35, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\7\\3.png')('\tReadRaster Extent: ', (3584, 1408, 512, 512), (0, 0, 256, 256))(36, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\8\\3.png')('\tReadRaster Extent: ', (4096, 1408, 512, 512), (0, 0, 256, 256))(37, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\0\\2.png')('\tReadRaster Extent: ', (0, 1920, 512, 512), (0, 0, 256, 256))(38, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\1\\2.png')('\tReadRaster Extent: ', (512, 1920, 512, 512), (0, 0, 256, 256))(39, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\2\\2.png')('\tReadRaster Extent: ', (1024, 1920, 512, 512), (0, 0, 256, 256))(40, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\3\\2.png')('\tReadRaster Extent: ', (1536, 1920, 512, 512), (0, 0, 256, 256))(41, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\4\\2.png')('\tReadRaster Extent: ', (2048, 1920, 512, 512), (0, 0, 256, 256))(42, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\5\\2.png')('\tReadRaster Extent: ', (2560, 1920, 512, 512), (0, 0, 256, 256))(43, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\6\\2.png')('\tReadRaster Extent: ', (3072, 1920, 512, 512), (0, 0, 256, 256))(44, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\7\\2.png')('\tReadRaster Extent: ', (3584, 1920, 512, 512), (0, 0, 256, 256))(45, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\8\\2.png')('\tReadRaster Extent: ', (4096, 1920, 512, 512), (0, 0, 256, 256))(46, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\0\\1.png')('\tReadRaster Extent: ', (0, 2432, 512, 512), (0, 0, 256, 256))(47, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\1\\1.png')('\tReadRaster Extent: ', (512, 2432, 512, 512), (0, 0, 256, 256))(48, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\2\\1.png')('\tReadRaster Extent: ', (1024, 2432, 512, 512), (0, 0, 256, 256))(49, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\3\\1.png')('\tReadRaster Extent: ', (1536, 2432, 512, 512), (0, 0, 256, 256))(50, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\4\\1.png')('\tReadRaster Extent: ', (2048, 2432, 512, 512), (0, 0, 256, 256))(51, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\5\\1.png')('\tReadRaster Extent: ', (2560, 2432, 512, 512), (0, 0, 256, 256))(52, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\6\\1.png')('\tReadRaster Extent: ', (3072, 2432, 512, 512), (0, 0, 256, 256))(53, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\7\\1.png')('\tReadRaster Extent: ', (3584, 2432, 512, 512), (0, 0, 256, 256))(54, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\8\\1.png')('\tReadRaster Extent: ', (4096, 2432, 512, 512), (0, 0, 256, 256))(55, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\0\\0.png')('\tReadRaster Extent: ', (0, 2944, 512, 512), (0, 0, 256, 256))(56, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\1\\0.png')('\tReadRaster Extent: ', (512, 2944, 512, 512), (0, 0, 256, 256))(57, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\2\\0.png')('\tReadRaster Extent: ', (1024, 2944, 512, 512), (0, 0, 256, 256))(58, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\3\\0.png')('\tReadRaster Extent: ', (1536, 2944, 512, 512), (0, 0, 256, 256))(59, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\4\\0.png')('\tReadRaster Extent: ', (2048, 2944, 512, 512), (0, 0, 256, 256))(60, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\5\\0.png')('\tReadRaster Extent: ', (2560, 2944, 512, 512), (0, 0, 256, 256))(61, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\6\\0.png')('\tReadRaster Extent: ', (3072, 2944, 512, 512), (0, 0, 256, 256))(62, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\7\\0.png')('\tReadRaster Extent: ', (3584, 2944, 512, 512), (0, 0, 256, 256))(63, '/', 63, 'C:\\dev\\stockpile_ground1\\4\\8\\0.png')('\tReadRaster Extent: ', (4096, 2944, 512, 512), (0, 0, 256, 256))Generating Overview Tiles:

أكثر...
 
أعلى