<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<table style="margin: 0px; padding: 0px; border: 0px; font-size: 13px; border-spacing: 0px; border-collapse: collapse; color: rgb(36, 39, 41); font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 16.9px; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">
<tbody style="margin: 0px; padding: 0px; border: 0px;">
<tr style="margin: 0px; padding: 0px; border: 0px;">
<td class="votecell" style="margin: 0px; padding: 0px 15px 0px 0px; border: 0px; vertical-align: top;">
<div class="vote" style="margin: 0px; padding: 0px; border: 0px; text-align: center; min-width: 46px;">
<span itemprop="upvoteCount" class="vote-count-post " style="margin: 8px 0px; padding: 0px; border: 0px; font-size: 20px; display: block; color: rgb(106, 115, 124);"><br class="Apple-interchange-newline">
<br>
</span><a class="vote-down-off" title="This question does not show any research effort; it is unclear or not useful" style="margin: 0px auto 10px; padding: 0px; border: 0px; font-size: 1px; color: rgb(0, 119, 204); cursor: pointer; overflow: hidden; display: block; text-indent: -9999em; width: 40px; height: 30px; background-image: url(file://composeviewinternalloadurl/img/sprites.svg?v=8c1c8cba242e), none; background-position: 0px -220px; background-repeat: no-repeat no-repeat;">down
vote</a><a class="star-off" href="http://stackoverflow.com/questions/38953211/using-gdalwarp-to-transform-from-wgs84-to-epsg3857-does-not-cover-world#" title="Click to mark as favorite question (click again to undo)" style="margin: 0px auto 2px; padding: 0px; border: 0px; font-size: 1px; color: rgb(0, 119, 204); text-decoration: none; cursor: pointer; overflow: hidden; display: block; text-indent: -9999em; width: 40px; height: 30px; background-image: url("img/sprites.svg?v=8c1c8cba242e"), none; background-size: initial; background-position: 0px -120px; background-repeat: no-repeat;">favorite</a>
<div class="favoritecount" style="margin: 0px; padding: 0px; border: 0px;"><span style="margin: 0px; padding: 0px; border: 0px; color: rgb(106, 115, 124);"></span></div>
</div>
</td>
<td class="postcell" style="margin: 0px; padding: 0px; border: 0px; vertical-align: top;">
<div style="margin: 0px; padding: 0px; border: 0px;">
<div class="post-text" itemprop="text" style="margin: 0px 0px 5px; padding: 0px; border: 0px; font-size: 15px; width: 660px; word-wrap: break-word; line-height: 1.3;">
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">i am using gdal 1.10 and 2.1.1.</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">i have a VRT datasource in WGS84 where i forced the corner coordinates to the min/max values of EPSG:3857 (-180,85.5,180,-85.5).</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">gdalinfo output for this VRT looks like this:</p>
<pre style="margin-top: 0px; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; word-wrap: normal; background-color: rgb(239, 240, 241);"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">Size is 1296001, 601200
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-180.000000000000000,85.500000000000000)
Pixel Size = (0.000277777563443,-0.000284431137725)
Corner Coordinates:
Upper Left (-180.0000000, 85.5000000) (180d 0' 0.00"W, 85d30' 0.00"N)
Lower Left (-180.0000000, -85.5000000) (180d 0' 0.00"W, 85d30' 0.00"S)
Upper Right ( 180.0000000, 85.5000000) (180d 0' 0.00"E, 85d30' 0.00"N)
Lower Right ( 180.0000000, -85.5000000) (180d 0' 0.00"E, 85d30' 0.00"S)
Center ( 0.0000000, -0.0000000) ( 0d 0' 0.01"E, 0d 0' 0.00"S)
Band 1 Block=128x128 Type=Int16, ColorInterp=Gray
</code></pre>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">Basically, i have the world minus the poles.</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">Now i want to convert this to EPSG:3857.</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">I use gdalwarp for this, using bilinear interpolation:</p>
<pre style="margin-top: 0px; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; word-wrap: normal; background-color: rgb(239, 240, 241);"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">./gdalwarp -of VRT -co TILED=YES -srcnodata 9999 -t_srs 'EPSG:3785' -multi wgs84.vrt wmerc.vrt -overwrite -r bilinear
</code></pre>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">running gdalinfo on wmerc then gives this:</p>
<pre style="margin-top: 0px; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; word-wrap: normal; background-color: rgb(239, 240, 241);"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">Size is 995026, 1025175
Coordinate System is:
PROJCS["Popular Visualisation CRS / Mercator (deprecated)",
GEOGCS["Popular Visualisation CRS",
DATUM["Popular_Visualisation_Datum",
SPHEROID["Popular Visualisation Sphere",6378137,0,
AUTHORITY["EPSG","7059"]],
TOWGS84[0,0,0,0,0,0,0],
AUTHORITY["EPSG","6055"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4055"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],
AUTHORITY["EPSG","3785"]]
Origin = (-20037508.342789247632027,20644642.363762538880110)
Pixel Size = (40.275313937642778,-40.275354414328227)
Corner Coordinates:
Upper Left (-20037508.343,20644642.364) (180d 0' 0.00"E, 85d28'11.27"N)
Lower Left (-20037508.343,-20644644.098) (180d 0' 0.00"E, 85d28'11.28"S)
Upper Right (20037476.183,20644642.364) (179d59'58.96"E, 85d28'11.27"N)
Lower Right (20037476.183,-20644644.098) (179d59'58.96"E, 85d28'11.28"S)
Center ( -16.0797308, -0.8670919) ( 0d 0' 0.52"W, 0d 0' 0.03"S)
Band 1 Block=512x128 Type=Int16, ColorInterp=Gray
NoData Value=9999
</code></pre>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">Note that the corner coordinates for upper/lower left look correct, but the corner coordinates for upper/lower right (the longitude) is missing is missing 32 units. Broadly put, i am missing
a sliver on the right side, but only in regards to the coordinates. The data is there, but the coordinates to the right seem wrong.</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">Why is that?</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">i <em style="margin: 0px; padding: 0px; border: 0px;">could</em> just modify the coordinates to match the world (longitudinal) using gdal_translate but i fear i am overlooking something
else here which might just come back to bite me.</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;"><br>
</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">Bet regards,</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;"><br>
</p>
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; clear: both;">Oliver</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>