Loading in a geotiff with projection of EPSG:4326 isn't fully rendering:
The original:
The original in Tilemill:
When using gdalwarp to change the projection from EPSG:4326 to EPSG:3857, tilemill will then load the full geotiff, but the geotiff has a black strip down the center.
The warped in Tilemill:
The command used for gdalwarp is:
gdalwarp -overwrite -s_srs EPSG:4326 -t_srs EPSG:3857 -r lanczos -srcnodata 0 -dstnodata 0 -of GTiff original.tif warped.tif
The question is, either how do we get gdalwarp to work correctly, without the black strip, or how do we get the original to show up correctly in Tilemill.
Answer
I've had similar issues with gdalwarp producing black strips around image edges. Usually these happen around the international dateline, but your edges appear to be around the central meridian instead so it's no wonder you wind up with an empty strip in the middle of the output GeoTIFF.
Try playing around with the -wo SOURCE_EXTRA=XXX
argument. Depending on your image resolution, you might try values anywhere between 100 - 1000 and see where the sweet spot is.
This option specifies a number of extra pixels to use during reprojection that should help minimize the effect. You may still wind up with a small black strip, but it shouldn't be as noticeable.
More information here.
If that doesn't work, you might also try increasing work/cache memory using -wm XXX
and --config GDAL_CACHEMAX XXX
, where XXX
is an integer representing megabytes.
No comments:
Post a Comment