<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.3790.4210" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=082381523-19112008>Hello,
list,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=082381523-19112008></SPAN></FONT><FONT
face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a <SPAN class=082381523-19112008>GDAL
</SPAN>warp operation creating only missing-values<SPAN
class=082381523-19112008> in the target map</SPAN>, </FONT></DIV>
<DIV><FONT face=Arial size=2>suggesting that the area I want to warp to is not
covered by the original image.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=082381523-19112008>Trying
to</SPAN> to trace the error, I <SPAN class=082381523-19112008>f</SPAN>ind
a strange behaviour of the </FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>GDALSuggestedWarpOutput()<SPAN
class=082381523-19112008> c</SPAN>all: The resulting target GeoTransform array
has </FONT></DIV>
<DIV><FONT face=Arial size=2>(almost) exactly the same values as the source
GeoTransform, even though the </FONT></DIV>
<DIV><FONT face=Arial size=2>projections are different.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Using GDAL 1.6.0b1<SPAN class=082381523-19112008>
under Windows</SPAN>, I have the following code</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial color=#0000ff>void</FONT><FONT face=Arial>
*hTransformArg = GDALCreateGenImgProjTransformer( pSrc, </FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=082381523-19112008> </SPAN>(LPCTSTR)
inWKT, </FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=082381523-19112008> </SPAN>NULL,</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=082381523-19112008> </SPAN>(LPCTSTR)
outWKT, </FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=082381523-19112008> </SPAN>FALSE,
0, 1 );</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>CPLAssert( hTransformArg != NULL );</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial color=#0000ff>if</FONT><FONT face=Arial>
(GDALSuggestedWarpOutput( pSrc, <FONT color=#008000>//
GDALDataset</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=082381523-19112008>
</SPAN>GDALGenImgProjTransform, </FONT><FONT color=#008000><FONT face=Arial>//
function</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=082381523-19112008>
</SPAN>hTransformArg, </FONT><FONT color=#008000><FONT face=Arial>// void
pointer</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=082381523-19112008>
</SPAN>adfDstGeoTransform, </FONT><FONT color=#008000><FONT face=Arial>// double
*</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=082381523-19112008>
</SPAN>&nPixels, </FONT><FONT color=#008000><FONT face=Arial>// int
*</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial><SPAN
class=082381523-19112008>
</SPAN>&nLines ) </FONT><FONT color=#008000><FONT face=Arial>// int
*</FONT></DIV></FONT></FONT>
<DIV><FONT face=Arial size=2>!= CE_None ) </FONT></DIV>
<DIV><FONT face=Arial size=2>{</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=082381523-19112008> </SPAN>AfxMessageBox(<FONT
color=#a31515>"GDALSuggestedWarpOutput failed"</FONT>);</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT color=#0000ff><SPAN
class=082381523-19112008> </SPAN>return</FONT>
NULL;</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Prior to the GDALCreateGenImgProjTransformer()
call, </FONT><FONT face=Arial size=2>inWKT is</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial>PROJCS[</FONT><FONT face=Arial><FONT
color=#a31515>"unnamed"</FONT>,GEOGCS[<FONT color=#a31515>"Normal Sphere
(r=6370997)"</FONT></FONT><FONT face=Arial>,</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>DATUM[</FONT><FONT face=Arial><FONT
color=#a31515>"unknown"</FONT>,SPHEROID[<FONT
color=#a31515>"sphere"</FONT></FONT><FONT
face=Arial>,6370997,0]],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PRIMEM[</FONT><FONT face=Arial><FONT
color=#a31515>"Greenwich"</FONT>,0],UNIT[<FONT
color=#a31515>"degree"</FONT></FONT><FONT
face=Arial>,0.0174532925199433]],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PROJECTION[</FONT><FONT face=Arial
color=#a31515>"Polar_Stereographic"</FONT><FONT
face=Arial>],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"latitude_of_origin"</FONT><FONT
face=Arial>,60],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"central_meridian"</FONT><FONT face=Arial>,0],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"scale_factor"</FONT><FONT face=Arial>,1],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"false_easting"</FONT><FONT face=Arial>,0],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"false_northing"</FONT><FONT face=Arial>,0],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>UNIT[</FONT><FONT face=Arial
color=#a31515>"Meter"</FONT><FONT face=Arial>,1]]</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>whereas outWKT is</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial>PROJCS[</FONT><FONT face=Arial><FONT
color=#a31515>"UTM 32 North (WGS84)"</FONT>,PROJECTION[<FONT
color=#a31515>"Transverse_Mercator"</FONT></FONT><FONT
face=Arial>],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"latitude_of_origin"</FONT><FONT
face=Arial>,0],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"central_meridian"</FONT><FONT face=Arial>,9],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"scale_factor"</FONT><FONT
face=Arial>,0.9996],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial
color=#a31515>"false_easting"</FONT><FONT
face=Arial>,500000],</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>PARAMETER[</FONT><FONT face=Arial><FONT
color=#a31515>"false_northing"</FONT>,0],UNIT[<FONT
color=#a31515>"Meter"</FONT></FONT><FONT face=Arial>,1]]</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The source GeoTransform matrix is:</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>- adfGeoTransform 0x0e3eaf58 </FONT><FONT
face=Arial color=#0000ff>double</FONT><FONT face=Arial> [6]</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>[0] 255106.00000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[1] 1000.0000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[2] 0.00000000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[3] -2511133.0000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[4] 0.00000000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT face=Arial size=2>[5] -1000.0000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial size=2>double</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>while</FONT></FONT><FONT face=Arial
size=2> after the GDALSuggestedWarpOutput call, the destination GeoTransform
is:</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>- adfDstGeoTransform,6 0x042bdd18
</FONT><FONT face=Arial color=#0000ff>double</FONT><FONT face=Arial>
[6]</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>[0] 255106.00000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[1] 999.99999999999989 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[2] 0.00000000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[3] -2511133.0000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[4] 0.00000000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[5] -999.99999999999989 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT face=Arial size=2>which is a mere copy of the source
numbers.</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial>As I afterwards specify the transform I want
</FONT><FONT face=Arial>for</FONT><FONT face=Arial> the warped
image:</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>- adfDstGeoTransform,6 0x042bdd18
</FONT><FONT face=Arial color=#0000ff>double</FONT><FONT face=Arial>
[6]</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>[0] 330000.00000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[1] 1000.0000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[2] 0.00000000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[3] 7280000.0000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[4] 0.00000000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT size=2><FONT face=Arial>[5] -1000.0000000000000 </FONT><FONT
color=#0000ff><FONT face=Arial>double</FONT></DIV></FONT></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>...my specified UL-Y [3] (7280000) is pretty far
from the suggested -2511133.</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>Can </FONT><FONT face=Arial>this</FONT><FONT
face=Arial> be a cause to my resulting image being empty?</FONT></FONT></DIV>
<DIV><SPAN class=082381523-19112008><FONT face=Arial size=2>This has been
working up to recently, but I have been working on this code as well as changing
the GDAL version.</FONT></SPAN></DIV>
<DIV><SPAN class=082381523-19112008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=082381523-19112008><FONT face=Arial size=2>Any
ideas?</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2>Best regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Sjur K :-)</FONT></DIV></BODY></HTML>