Index: vrtwarped.cpp
===================================================================
--- vrtwarped.cpp	(revision 10707)
+++ vrtwarped.cpp	(working copy)
@@ -120,22 +120,55 @@
 /* -------------------------------------------------------------------- */
     psWO->pfnTransformer = GDALGenImgProjTransform;
     psWO->pTransformerArg = 
-        GDALCreateGenImgProjTransformer( psWO->hSrcDS, pszSrcWKT, NULL, NULL,
-                                         TRUE, 1.0, 0 );
+        GDALCreateGenImgProjTransformer( psWO->hSrcDS, pszSrcWKT, NULL, pszDstWKT,
+                                         TRUE, 1000.0, 0 );
 
 /* -------------------------------------------------------------------- */
 /*      Figure out the desired output bounds and resolution.            */
 /* -------------------------------------------------------------------- */
     double adfDstGeoTransform[6];
+    double adfExtent[4];
     int    nDstPixels, nDstLines;
+    double dfWrkMinX=0, dfWrkMaxX=0, dfWrkMinY=0, dfWrkMaxY=0;
+    double dfWrkResX=0, dfWrkResY=0;
+
     CPLErr eErr;
 
     eErr = 
-        GDALSuggestedWarpOutput( hSrcDS, psWO->pfnTransformer, 
+        GDALSuggestedWarpOutput2( hSrcDS, psWO->pfnTransformer, 
                                  psWO->pTransformerArg, 
-                                 adfDstGeoTransform, &nDstPixels, &nDstLines );
+                                 adfDstGeoTransform, &nDstPixels, &nDstLines,
+                                 adfExtent, 0 );
 
 /* -------------------------------------------------------------------- */
+/*      Expand the working bounds to include this region, ensure the    */
+/*      working resolution is no more than this resolution.             */
+/* -------------------------------------------------------------------- */
+        
+    dfWrkMinX = adfExtent[0];
+    dfWrkMaxX = adfExtent[2];
+    dfWrkMaxY = adfExtent[3];
+    dfWrkMinY = adfExtent[1];
+    dfWrkResX = adfDstGeoTransform[1];
+    dfWrkResY = ABS(adfDstGeoTransform[5]);
+
+/* -------------------------------------------------------------------- */
+/*      Turn the suggested region into a geotransform and suggested     */
+/*      number of pixels and lines.                                     */
+/* -------------------------------------------------------------------- */
+    
+    adfDstGeoTransform[0] = dfWrkMinX;
+    adfDstGeoTransform[1] = dfWrkResX;
+    adfDstGeoTransform[2] = 0.0;
+    adfDstGeoTransform[3] = dfWrkMaxY;
+    adfDstGeoTransform[4] = 0.0;
+    adfDstGeoTransform[5] = -1 * dfWrkResY;
+
+    nDstPixels = (int) ((dfWrkMaxX - dfWrkMinX) / dfWrkResX + 0.5);
+    nDstLines = (int) ((dfWrkMaxY - dfWrkMinY) / dfWrkResY + 0.5);
+
+
+/* -------------------------------------------------------------------- */
 /*      Update the transformer to include an output geotransform        */
 /*      back to pixel/line coordinates.                                 */
 /*                                                                      */

