<div dir="ltr">Hi,<div><br></div><div>I'm rendering a 256x256 tile from a mercury dem. I noticed the gdalwarp is producing a bad output when using interpolation with the following command</div><div><br></div><div><font face="monospace">gdalwarp -of PNG -r bilinear -t_srs '+proj=eqc +a=2439700 +b=2439700 +lon_0=0.000000 +lat_0=0.000000 +x_0=0 +y_0=0 +units=m +no_defs' -ts 256 256 -te -958067.949620 -958067.950079 0.000460 0.000000 -overwrite msgr_dem_low_res.tif tile.png</font><br></div><div><br></div><div>The output image is kind of blurred/low resolution</div><div><img src="cid:ii_lz1bcq6m0" alt="tile.png" width="256" height="256"><br></div><div><br></div><div>On the other side, it looks good if nearest interpolation is used</div><div><br></div><div><span style="font-family:monospace">gdalwarp -of PNG -t_srs '+proj=eqc +a=2439700 +b=2439700 +lon_0=0.000000 +lat_0=0.000000 +x_0=0 +y_0=0 +units=m +no_defs' -ts 256 256 -te -958067.949620 -958067.950079 0.000460 0.000000 -overwrite msgr_dem_low_res.tif tile.png</span><br></div><div><span style="font-family:monospace"><br></span></div><img src="cid:ii_lz1bdnwv1" alt="tile.png" width="256" height="256"><div><br><div><br clear="all"><div>The problem seems related to the fact that the right edge of the tile is around longitude 0, while the source image is a full globe/360 degrees image centered at 180 longitude</div><div><br></div><div>If I reduce the tile size to 255x255 for avoiding the 0 longitude at the edge, then the interpolated output file looks much better</div><div><br></div><div><font face="monospace">gdalwarp -of PNG -r bilinear -t_srs '+proj=eqc +a=2439700 +b=2439700 +lon_0=0.000000 +lat_0=0.000000 +x_0=0 +y_0=0 +units=m +no_defs' -ts 255 255 -te -958067.949620 -950583.044220 -7484.905400 0.000000 -overwrite msgr_dem_low_res.tif tile_255.png</font><br></div><div><font face="monospace"><br></font></div><div><img src="cid:ii_lz1binr62" alt="tile_255.png" width="255" height="255"><br></div><div><br></div><div>Am I doing something wrong or is this a bug in GDAL?</div><div><br></div><div>I'm using the mercury dem from here</div><div><a href="https://pdsimage2.wr.usgs.gov/Messenger/MESSDEM_1001/DEM/GLOBAL/IMG/" target="_blank">https://pdsimage2.wr.usgs.gov/Messenger/MESSDEM_1001/DEM/GLOBAL/IMG/</a><br></div><div>Here is a lower resolution of the same dem for testing purpose</div><div><a href="https://pdsimage2.wr.usgs.gov/Messenger/MESSDEM_1001/DEM/GLOBAL/IMG/" target="_blank">https://</a><span style="color:rgb(22,25,31);font-family:"Amazon Ember","Helvetica Neue",Roboto,Arial,sans-serif;font-size:14px"><a href="http://files.actgate.com/terrain/mercury/msgr_dem_low_res.tif" target="_blank">files.actgate.com/terrain/mercury/msgr_dem_low_res.tif</a></span><br></div><div><br></div><div>Thanks in advance for your help,</div><div>Calogero Mauceri</div></div></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Calogero Mauceri<br>Software Engineer<br><br>Applied Coherent Technology Corporation (ACT)<br><a href="http://www.actgate.com" target="_blank">www.actgate.com</a><br></div></div></div>