I'm trying to split a georeferenced TIFF image into several tiles for further processing.
I have managed to calculate a single tile and give it the right CRS, evething fine so far.
Once I load the tile up in QGIS, it shows me that the top left corner of the tile is at 0/0. It should be arround 483544,5579377.
I suppose that somehow I am missing to give the right transformation. The code looks like this:
with rasterio.open(imgPath) as src: tile = src.read(1, window=Window(1000, 1000, 500, 300)) test = rasterio.open(imgPath) print(test.crs)# 25832 with rasterio.open(resPath, 'w',driver='GTiff', width=500, height=300, count=1, dtype=tile.dtype, crs=src.crs) as dst: dst.write(tile, window=Window(0, 0, 500, 300), indexes=1) print(dst.crs)#25832
Before anyone asks, I have build this very same tool using GDAL and calling it via subprocess, but it is a nightmare to bundle up with pyinstaller, so I want to try it this way and hope for the best.