0

I am trying to align two rasters, one with 0.04 pixel and another with 10 pixel. I tired the QGIS tool align with raster. I put the 0.04 image as reference but that makes my 10 pixel image really big in size due to which i am having trouble training my neural network. And when I try the opposite my 0.04 image cellsize become 10 which is not what I want. I also tired with GDAL warp but in QGIS Python console but the code works but does not create any output image

Name    group1
Path    E:\image\group1.tif
CRS EPSG:32614 - WGS 84 / UTM zone 14N - Projected
Extent  690154.9840000000549480,1870070.4596800000872463 : 691166.2515500000445172,1871168.6740900001022965
Unit    meters
Width   23285
Height  25287
Dimensions  X: 23285 Y: 25287 Bands: 4
Origin  690155,1.87117e+06
Pixel Size  0.04343000000000000332,-0.04343000000000000332
Name    sateliite
Path    E:\image\sateliite.tif
CRS EPSG:32614 - WGS 84 / UTM zone 14N - Projected
Extent  690100.0000000000000000,1870060.0000000000000000 : 691280.0000000000000000,1871190.0000000000000000
Unit    meters
Width   118
Height  113
Dimensions  X: 118 Y: 113 Bands: 10
Origin  690100,1.87119e+06
Pixel Size  10,-10

import gdal fn = r"E:\image\group1.tif" opu ="G:\all files\newrgb.tif" gdal.Warp(opu,fn,dstSRS = "EPSG: 32614",xRes= "0.04343000000000000332",yRes="-0.04343000000000000332",outputBounds="690100.0000000000000000,1870060.0000000000000000 : 691280.0000000000000000,1871190.0000000000000000")

so the extent is of satellite image

Ian Turton
  • 81,417
  • 6
  • 84
  • 185
user123
  • 195
  • 8
  • Since 10 is evenly divisible by 0.04, you just need to shift the 10 pixelsize raster by no more than 0.02 to have them in alignment. In ArcGIS the utility to do this is Shift. See https://gis.stackexchange.com/questions/131761/how-to-shift-a-raster-in-qgis – Vince Sep 15 '21 at 10:39
  • Doesnot work there is a difference of about 5 meters – user123 Sep 15 '21 at 11:19
  • You can shift the 10m raster by up to 5m without compromising it, but I wouldn't without being sure it was appropriate (by using vector data to evaluate the affect). It's still a Shift operation, no matter the difference. – Vince Sep 15 '21 at 12:04
  • This 0.02 is in meter right? In the ArcMap the field has shift by x and y co-ordinates. – user123 Sep 15 '21 at 12:29
  • It's unlikely to be exactly midpoint. You need to do the math to align the intervals. – Vince Sep 15 '21 at 14:08
  • Can you elaborate on that how to calculate how much of mis-alignment are on the raster – user123 Sep 15 '21 at 14:36
  • Well, 10.0m is not evenly divisible by 0.04343m the way it is by 0.040m, so it's not possible with this dataset. – Vince Sep 15 '21 at 15:16

0 Answers0