New answers tagged


As with what @user30184 said, the issue is with the 4th NIR band been read as the mask band. After only extracting 3 band then writing it out, the PNG shows the correct picture.


eventually this worked for me: dataset =, 'r') bands = [1, 2, 3] data = transform = rasterio.transform.from_bounds(west, south, east, north, data.shape[1], data.shape[2]) crs = {'init': 'epsg:3006'} with, 'w', driver='GTiff', width=data.shape[1], height=data....


Check out gdalwarp that is part of the GDAL library. There are Python bindings available through the osgeo package. This is untested, but it should get you close to what you need: from osgeo import gdal gdal.Warp( dstDS, srcDS, format='GTiff', dstSRS='EPSG:3006', outputBounds=[minX, minY, maxX, maxY] ) You'll need to define the source and ...

Top 50 recent answers are included