Re: [gdal-dev] Dataset's ReadRaster/WriteRaster throws exception on c#

2018-11-12 Thread Tamas Szekeres
You did not count the band size when allocating memory for the buffer. That should be: byte[] readRaster = new byte[tileSize * tileSize * 4]; Or alternatively use Band.ReadRaster to read just a specific band. Best regards, Tamas Gigas002 ezt írta (időpont: 2018. nov. 12., H, 17:34): > Hi

[gdal-dev] Dataset's ReadRaster/WriteRaster throws exception on c#

2018-11-12 Thread Gigas002
Hi all. I've rewritten some python code from gdal2tiles.py on c#, using GDAL.NET nuget package (ver. 2.3.1). Here you can see the working python code: def create_overview_tiles(input_file, output_file): tile_driver = 'PNG' tile_size = 256 tilebands = 4 resampling =