<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello,<br>
<br>
</p>
<p>I am trying to resample a .tif raster in C# GDAL in a way that every other cell in a row and column is removed.<br>
<br>
Something similar to the lower GDAL command:<br>
<br>
gdal_translate -outsize 50% 0 input.tif output.tif<br>
<br>
But this command creates a new resampled .tif file.<br>
While I would like to avoid saving a new .tif file, and if possible just resample the dataset.</p>
<p>It looks like this can be achieved by the use of <a title="Ctrl+Click or tap to follow the link" href="http://www.gdal.org/gdal_vrttut.html">
VRT file</a>.<br>
</p>
<p>Here is one example of a .vrt file, which resamples the .tif file by removing the every other cell:</p>
<p></p>
<p id="yui_3_16_0_ym19_1_1461001679262_2818"><br>
</p>
<blockquote id="yui_3_16_0_ym19_1_1461001679262_2853">
<p dir="ltr" id="yui_3_16_0_ym19_1_1461001679262_2795"><VRTDataset rasterXSize="42" rasterYSize="32">
<br id="yui_3_16_0_ym19_1_1461001679262_2807">
<GeoTransform>14.3779166666, 0.000833333333333, 0.0, 40.8404166667, 0.0, -0.000833333333333</GeoTransform>
<br id="yui_3_16_0_ym19_1_1461001679262_2808">
<VRTRasterBand dataType="Byte" band="1"> <br id="yui_3_16_0_ym19_1_1461001679262_2809">
<ColorInterp>Gray</ColorInterp> <br id="yui_3_16_0_ym19_1_1461001679262_2810">
<SimpleSource resampling="bilinear"> <br id="yui_3_16_0_ym19_1_1461001679262_2811">
<SourceFilename relativeToVRT="1">vesuvius_wgs84.tif</SourceFilename> <br id="yui_3_16_0_ym19_1_1461001679262_2812">
<SourceBand>1</SourceBand> <br id="yui_3_16_0_ym19_1_1461001679262_2813">
<SrcRect xOff="0" yOff="0" xSize="85" ySize="65"/> <br id="yui_3_16_0_ym19_1_1461001679262_2814">
<DstRect xOff="0" yOff="0" xSize="42" ySize="32"/> <br id="yui_3_16_0_ym19_1_1461001679262_2815">
</SimpleSource> <br id="yui_3_16_0_ym19_1_1461001679262_2816">
</VRTRasterBand> <br id="yui_3_16_0_ym19_1_1461001679262_2817">
</VRTDataset></p>
</blockquote>
<p id="yui_3_16_0_ym19_1_1461001679262_2824" dir="ltr"><br>
</p>
What I noticed is that resolution of the resampled dataset does not change in comparison to the original dataset.
<p></p>
<p>In this case it remains the 0.00083 degrees.<br>
The same thing happens if I reproject the .tif file to some projected coordinate system (UTM for example): resolution remains the same (70 meters for example).<br>
<br>
Why is this the case?<br>
<br>
Shouldn't the resolution of the resampled dataset be twice of the resolution of the original (non-resampled) dataset, based on the fact that every other cell is removed (original dataset: 85x65, resampled dataset: 42x32)?</p>
<p><br>
</p>
<p>I would be very grateful if I could get any kind of reply.<br>
<br>
Thank you in advance.<br>
<br>
With kind regards,<br>
Didier<br>
</p>
</div>
</body>
</html>