I want to resample a raster image (GeoTiff, 5 bands) from 7,29 cm to 25 cm. There are numerous tools for resampling, but I figured out that RigidTransformResample should be the function that does what I want.
Now, there is no way to tell the function directly that my output cell size shall be 25 cm but one has to calculate (?) translation parameters. There are three different ways to resample:
- id (spatial scaling, 2 parameters)
- translation (translation, 2 OR 4 parameters (unclear which to use, documentation should have an example for each case)
- rotation (rotataion, 1 or 3 parameters)
Now I thought spatial scaling (id) would be the right way and I thought that given 25 / 7 is about 3.4, so I wrote the arguments transform.id.scalex= 3.4 transform.id.scaley = 3.4 but the spacing changed from 7cm to 2cm in X and remained the same in Y !
This is the image information before:
Image general information:
Number of bands : 5
No data flags :
Band 1: -10000
Band 2: -10000
Band 3: -10000
Band 4: -10000
Band 5: -10000
Start index : [0,0]
Size : [21726,12037]
Origin : [486232,6.04546e+06]
Spacing : [0.07289,-0.07289]
Estimated ground spacing (in meters): [0.0726658,0.072863]
This was my command line:
otbcli_RigidTransformResample -in C:\Users\oldel\Documents\Nordstrandischmoor_Multispectral_RedEdge\otbConcatenateImages.tif -out C:\Users\oldel\Documents\Nordstrandischmoor_Multispectral_RedEdge\rigitTransformImage_ID.tif -transform.type id -transform.type.id.scalex 3.44 transform.type.id.scaley 3.431 -interpolator bco
and this was the output image
Image general information:
Number of bands : 5
No data flags :
Band 1: -10000
Band 2: -10000
Band 3: -10000
Band 4: -10000
Band 5: -10000
Start index : [0,0]
Size : [74737,12037]
Origin : [486232,6.04546e+06]
Spacing : [0.021189,-0.07289]
Estimated ground spacing (in meters): [0.0211247,0.072863]
Could anyone please explain how to get from 7 to 25cm using image resampling?
Thank you in advance