Open griembauer opened 1 year ago
r.tile
sets initially a single dummy output region for all tiles in L114. It then reads the input raster row by row and distributes the data over the corresponding tiles. This way each input raster row needs to be read only once. Rasters for output tiles are created in L136, using the dummy region which is also used by GDAL to create the output tif. Once an output tile is complete, the correct region is set in L185 with Rast_put_cellhd()
. This information is however not passed to GDAL which would need to modify the already set geotransform information. In order to fix this, Rast_put_cellhd()
would need to be enabled to update the GDAL output file information. Not sure if this is feasible without substantial changes to the GRASS raster lib and the GRASS GDAL interface therein.
Describe the bug Using
r.external.out
to directly write to .tif files in combination withr.tile
creates result tile raster files that have the correct pixel values but are stretched to match the entire current region extent. Also the pixel size is stretched accordingly. All tile raster files then have the same extent.To Reproduce In the NC sample location Set the region to the elevation raster
Run
r.external.out
Run
r.tile
While the resulting tiles in GRASS have the expected extent, the written raster files are stretched to the region extent. This can be analyzed in a different GIS or by checking any tile in
gdalinfo
:(deactivate GDAL output by
r.external.out
)Expected behavior Each resulting .tif raster should have the correct extent and resolution such that they form a mosaic of the original input raster used in
r.tile
System description (please complete the following information):