<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></p>
<div>Hello to GDAL community.<br>
<br>
I have one issue, and I would be very grateful if somebody could give me any kind of help.<br>
<br>
I have two rasters of the area around <a href="https://www.google.rs/maps/place/40%C2%B048'45.6%22N+14%C2%B024'51.3%22E/@40.840774,14.2281818,10z/data=!4m5!3m4!1s0x0:0x0!8m2!3d40.81266!4d14.414252">
Mount Vesuvius</a>: one spans 20 kilometers, and the other one 50 kilometers (these distances are not so important for the problem). Both rasters are in WGS84 geographic coordinate system, and they overlap between each other. Here is the
<a href="https://www.dropbox.com/s/nza0edj0n4kilfi/vesuvius_radius_20_50KM_overlap.jpg?dl=0">
preview of those two WGS84 rasters</a> in QGIS.<br>
<br>
When I use <a title="Ctrl+Click or tap to follow the link" href="https://docs.qgis.org/2.2/en/docs/user_manual/working_with_raster/raster_calculator.html">
QGIS Raster calculator</a> to calculate the difference between them, a new raster file is created which is totally black - so it shows that there is absolutely no difference in cell values on the part where they overlap. Here is the preview of
<a href="https://www.dropbox.com/s/c19jj6c3a8if1n2/vesuvius_radius_20-50KM.jpg?dl=0">
difference between the two WGS84 rasters</a>.<br>
<br>
However, when I project both rasters to Azimuthal equidistant projection, and again check for the difference with Raster calculator: the
<a title="Ctrl+Click or tap to follow the link" href="https://www.dropbox.com/s/c4mnpm4szr1l4cq/vesuvius_radius_20-50KM_cubic_aeqd.jpg?dl=0">
difference between these two reprojected Azimuthal equidistant rasters exists</a>!
<br>
I used cubic resampling method, but I get similar results with bilienear method.<br>
<br>
The reason for this is because once <i>vesuvius_radius_20KM.tif</i> and <i>vesuvius_radius_50KM.tif</i> are reprojected, their grids do not overlap anymore, and their cell sizes slightly differ (79.1578,-79.1578 vs 79.1628,-79.1628).<br>
<br>
<br>
So if I reproject the initial <i>vesuvius_radius_20KM.tif</i> and <i>vesuvius_radius_50KM.tif</i> rasters, but by fixing the cell size (to 100 meters for example) and by fixing the extents, two rasters would now need to have exactly the same values in their
cells on the central part (where they overlap).<br>
But they do not!! There is still a difference between them. Smaller difference but it still exists. Here is a
<a href="https://www.dropbox.com/s/gxdbd1l34jo12uk/vesuvius_radius_20-50KM_cubic_aeqd_cellsize100m.jpg?dl=0">
preview of that difference</a>.<br>
<br>
Why?<br>
That's my question and the point of my email.<br>
Their grids now match each other, and their cellsizes are exactly 100,100 meters. So why does the difference exist at the part where they overlap?<br>
<br>
I am only interested in projecting the WGS84 rasters to <span>Azimuthal equidistant</span>, but just for the sake of checking, I tried using Transverse Mercator projection (instead of Azimuthal equidistant), and again the difference exists.<br>
<br>
I am using GDAL 2.0 and Raster Calculator from QGIS 2.8.7 (to calculate the difference between rasters).<br>
<br>
Is this some sort of bug related with GDAL 2.0?<br>
<br>
I would be very grateful if I could get any kind of reply on this issue.<br>
Thank you in advance.<br>
<br>
P.S<br>
<br>
<br>
<br>
<i>Additional information</i>:<br>
<br>
<div>Here are the initial raster files (in <b>WGS84</b>):<br>
<a id="LPlnk520185" href="https://www.dropbox.com/s/pudw8vbgil9ti69/vesuvius_radius_20KM.tif?dl=0">https://www.dropbox.com/s/pudw8vbgil9ti69/vesuvius_radius_20KM.tif?dl=0</a><br>
<a id="LPlnk183299" href="https://www.dropbox.com/s/k30x4c5442g8028/vesuvius_radius_50KM.tif?dl=0">https://www.dropbox.com/s/k30x4c5442g8028/vesuvius_radius_50KM.tif?dl=0</a><br>
<br>
Here are the <b>Azimuthal equidistant projected rasters with fixed cell sizes and extents</b>:<br>
<a id="LPlnk327866" href="https://www.dropbox.com/s/cmw1uk3qe09k2u2/vesuvius_radius_20KM_cubic_aeqd_cellsize100m.tif?dl=0">https://www.dropbox.com/s/cmw1uk3qe09k2u2/vesuvius_radius_20KM_cubic_aeqd_cellsize100m.tif?dl=0</a><br>
<a id="LPlnk220372" href="https://www.dropbox.com/s/9yiwc2r6rfd6bgd/vesuvius_radius_50KM_cubic_aeqd_cellsize100m.tif?dl=0">https://www.dropbox.com/s/9yiwc2r6rfd6bgd/vesuvius_radius_50KM_cubic_aeqd_cellsize100m.tif?dl=0</a><br>
<br>
And the <b>difference</b> between the two upper Azimuthal equidistant projected rasters:<br>
<a id="LPlnk482275" href="https://www.dropbox.com/s/jprwjpf44rotnva/vesuvius_radius_20-50KM_cubic_aeqd_cellsize100m.tif?dl=0">https://www.dropbox.com/s/jprwjpf44rotnva/vesuvius_radius_20-50KM_cubic_aeqd_cellsize100m.tif?dl=0</a><br>
</div>
<br>
<br>
<br>
<div><span><span>To project the initial WGS84 raster files <b>to Transverse Mercator projection</b></span>:</span>
<p id="yui_3_16_0_ym19_1_1462979003139_6765"></p>
<div>
<blockquote id="yui_3_16_0_ym19_1_1462979003139_6658">
<p id="yui_3_16_0_ym19_1_1462979003139_6808">gdalwarp -s_srs EPSG:4326 -t_srs EPSG:32633 -r cubic -of GTiff "C:/vesuvius_radius_20KM.tif" "C:/vesuvius_radius_20KM_cubic_tm.tif"</p>
<p id="yui_3_16_0_ym19_1_1462979003139_6809"><br id="yui_3_16_0_ym19_1_1462979003139_6810">
</p>
<p id="yui_3_16_0_ym19_1_1462979003139_6813" data-setdir="false" dir="ltr">gdalwarp -s_srs EPSG:4326 -t_srs EPSG:32633 -r cubic -of GTiff "C:/vesuvius_radius_50KM.tif" "C:/vesuvius_radius_50KM_cubic_tm.tif"</p>
</blockquote>
</div>
</div>
<br>
<div>
<p data-setdir="false" dir="ltr"><span><span>To project the initial WGS84 raster files
<b>to Azimuthal equidistant projection</b></span>:</span></p>
<blockquote id="yui_3_16_0_ym19_1_1462979003139_6658">
<p id="yui_3_16_0_ym19_1_1462979003139_6722">gdalwarp -s_srs EPSG:4326 -t_srs "+proj=aeqd +lat_0=40.81266 +lon_0=14.414252" -r cubic -of GTiff "C:/vesuvius_radius_20KM.tif" "C:/vesuvius_radius_20KM_cubic_aeqd.tif"</p>
<p id="yui_3_16_0_ym19_1_1462979003139_6723"><br>
</p>
<p id="yui_3_16_0_ym19_1_1462979003139_6713" data-setdir="false" dir="ltr">gdalwarp -s_srs EPSG:4326 -t_srs "+proj=aeqd +lat_0=40.81266 +lon_0=14.414252" -r cubic -of GTiff "C:/vesuvius_radius_50KM.tif" "C:/vesuvius_radius_50KM_cubic_aeqd.tif"</p>
</blockquote>
<p id="yui_3_16_0_ym19_1_1462979003139_6606" data-setdir="false" dir="ltr"><br>
</p>
<span><span></span></span></div>
<div>To project the initial WGS84 raster files <b>to Azimuthal equidistant projection by fixing cell size and extents</b>:<br>
</div>
<div>
<blockquote id="yui_3_16_0_ym19_1_1462979003139_6658">
<p id="yui_3_16_0_ym19_1_1462979003139_6584" data-setdir="false" dir="ltr">gdalwarp -overwrite -te -25000 -18000 14000 21000 -tr 100 100 -s_srs EPSG:4326 -t_srs "+proj=aeqd +lat_0=40.81266 +lon_0=14.414252 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs" -r cubic
-of GTiff "C:/vesuvius_radius_20KM.tif" "C:/vesuvius_radius_20KM_cubic_aeqd_cellsize100m.tif"</p>
<p id="yui_3_16_0_ym19_1_1462979003139_6660" data-setdir="false" dir="ltr"><br>
</p>
<p id="yui_3_16_0_ym19_1_1462979003139_6670" data-setdir="false" dir="ltr">gdalwarp -overwrite -te -56000 -48000 44000 51000 -tr 100 100 -s_srs EPSG:4326 -t_srs "+proj=aeqd +lat_0=40.81266 +lon_0=14.414252 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs" -r cubic
-of GTiff "C:/vesuvius_radius_50KM.tif" "C:/vesuvius_radius_50KM_cubic_aeqd_cellsize100m.tif"</p>
</blockquote>
<br>
</div>
</div>
<p></p>
</div>
</body>
</html>