From what I gathered gdalwarp not only clips but also resamples the image. You can comfirm this by checking the info on the original raster (specifically the pixel size).
Essentially there's 2 ways to handle clipping a raster that we're seeing here:
The benefit of the FME way is that every resulting pixel still matches with the original one. With the GDAL way I'm not so sure.
If you want FME to behave in the GDAL way you'll have to figure out the current pixel size and then resample the raster so that its new pixels line up perfectly with the clip polygon before clipping. To be honest, I can't really say how to do that right now :) (but I'm jetlagged)
@redgeographics Thanks for the answer but I have a question here:
I used also other tool like presented here:
https://gis.stackexchange.com/questions/200407/merging-gdal-tiles-and-crop-via-bounding-box
gdalwarp command that I used is:
gdalwarp.exe -of GTiff -co COMPRESS=LZW -cutline clipper.kml -crop_to_cutline tiffFilesToBeClippedAndMerged.vrt result.t
and the gdal info for file generated this way is:
Origin = (540000.000000000116415,6170000.000000001862645) Pixel Size = (0.699986000280060,-0.699986000280581) Metadata: AREA_OR_POINT=Area Image Structure Metadata: COMPRESSION=LZW INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 540000.000, 6170000.000) ( 9d38' 9.67"E, 55d40'27.01"N) Lower Left ( 540000.000, 6160000.000) ( 9d38' 4.44"E, 55d35' 3.56"N) Upper Right ( 550000.000, 6170000.000) ( 9d47'42.04"E, 55d40'23.68"N) Lower Right ( 550000.000, 6160000.000) ( 9d47'35.50"E, 55d35' 0.23"N) Center ( 545000.000, 6165000.000) ( 9d42'52.91"E, 55d37'43.71"N)
while for raster processed with fme like I described above it is:
Origin = (540000.000039999955334,6169999.800039999186993) Pixel Size = (0.700000000000000,-0.699951000979980) Metadata: AREA_OR_POINT=Area Image Structure Metadata: COMPRESSION=LZW INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 540000.000, 6169999.800) ( 9d38' 9.67"E, 55d40'27.01"N) Lower Left ( 540000.000, 6160000.300) ( 9d38' 4.44"E, 55d35' 3.57"N) Upper Right ( 550000.200, 6169999.800) ( 9d47'42.05"E, 55d40'23.67"N) Lower Right ( 550000.200, 6160000.300) ( 9d47'35.51"E, 55d35' 0.24"N) Center ( 545000.100, 6165000.050) ( 9d42'52.92"E, 55d37'43.72"N)
So I wonder what can I do in FME to have the same results as I have using GDAL?
hello @nielsgerrits
it is both x/y 0.7
What is the raster cell size? RasterPropertyExtractor --> _spacing_x / y