Hi, 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
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 The output image is kind of blurred/low resolution [image: tile.png] On the other side, it looks good if nearest interpolation is used 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 [image: tile.png] 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 If I reduce the tile size to 255x255 for avoiding the 0 longitude at the edge, then the interpolated output file looks much better 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 [image: tile_255.png] Am I doing something wrong or is this a bug in GDAL? I'm using the mercury dem from here https://pdsimage2.wr.usgs.gov/Messenger/MESSDEM_1001/DEM/GLOBAL/IMG/ Here is a lower resolution of the same dem for testing purpose https:// <https://pdsimage2.wr.usgs.gov/Messenger/MESSDEM_1001/DEM/GLOBAL/IMG/> files.actgate.com/terrain/mercury/msgr_dem_low_res.tif Thanks in advance for your help, Calogero Mauceri -- Calogero Mauceri Software Engineer Applied Coherent Technology Corporation (ACT) www.actgate.com
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev