I am having the following issue when reprojecting imagery tiles using gdalwarp.

These are 4096x4096 imagery tiles, which I'm gdalwarp'ing from WGS84 to a State Plane projection. When reprojected, the tiles, naturally, overlap, and so have added an alpha channel which takes care of it nicely.

However, when viewed together, after reprojection, the tile edges don't quite match up. Note also that this is NOT an issue or artifact with the alpha channel---I can use nodata instead of alpha, or just leave the area black, and the edges remain broken, with holes, just the same. Below is an example of a 1:80 scale crop of the seam between two tiles after projection. It maintains this pattern of holes along the entire seam between two tiles.

The basic command I'm using looks something like this:

gdalwarp -s_srs EPSG:4326 -t_srs EPSG:0000 /path/to/source.jp2 /path/to/dest.tif

I've exhausted most of the options I can think of from gdalwarp ( http://www.gdal.org/gdalwarp.html ) and the warp options ( http://www.gdal.org/structGDALWarpOptions.html#a0ed77f9917bb96c7a9aabd73d4d06e08 ), including different resampling methods, increasing the SAMPLE_STEPS density, and playing with additional SOURCE_EXTRA pixels. All with no change whatsoever.

I realize creating a mosaic first, reprojecting, and then retiling would be one way around this issue, but I'm dealing with tens of thousands of these ~16 megapixel tiles, so as far as I can tell, a mosaic is not feasible.

Any ideas on an approach to deal with these edge inaccuracies? Thanks!

Seam between tiles


Creating a mosaic from your source images takes only a few seconds if you use GDAL virtual raster as output. Read

http://www.gdal.org/gdal_vrttut.html and http://www.gdal.org/gdalbuildvrt.html

Often the artifacts like you have can also be avoided by taking care that the individually warped images are aligned to use a common canvas. This can be achieved by using -tap parameter together with -tr parameter. I would try that first. Read about -tap from http://www.gdal.org/gdalwarp.html

  • Thank you! The -tr and -tap combination did indeed solve the problem! To expand on that, because my target SRS was in feet and my imagery was 6-inch, the final command, using -tr and -tap looked something like this: gdalwarp -tr 0.5 0.5 -tap -s_srs EPSG:4326 -t_srs EPSG:0000 /path/to/source.jp2 /path/to/dest.tif – John Sercel Jul 21 '14 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.