[gdal-dev] (no subject)

Kolberg Sjur A Sjur.A.Kolberg at sintef.no
Wed Nov 19 18:34:53 EST 2008


Hello, list,
 
I have a GDAL warp operation creating only missing-values in the target
map, 
suggesting that the area I want to warp to is not covered by the
original image.
 
Trying to to trace the error, I find a strange behaviour of the 
GDALSuggestedWarpOutput() call: The resulting target GeoTransform array
has 
(almost) exactly the same values as the source GeoTransform, even though
the 
projections are different.
 
Using GDAL 1.6.0b1 under Windows, I have the following code
 
void *hTransformArg = GDALCreateGenImgProjTransformer( pSrc, 
 
(LPCTSTR) inWKT, 
 
NULL,
 
(LPCTSTR) outWKT, 
 
FALSE, 0, 1 );
CPLAssert( hTransformArg != NULL );
if (GDALSuggestedWarpOutput( pSrc, // GDALDataset
                                                GDALGenImgProjTransform,
// function
                                                hTransformArg, // void
pointer
                                                adfDstGeoTransform, //
double *
                                                &nPixels, // int *
                                                &nLines ) // int *
!= CE_None ) 
{
    AfxMessageBox("GDALSuggestedWarpOutput failed");
    return NULL;
}
 
Prior to the GDALCreateGenImgProjTransformer() call, inWKT is
 
PROJCS["unnamed",GEOGCS["Normal Sphere (r=6370997)",
DATUM["unknown",SPHEROID["sphere",6370997,0]],
PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],
PROJECTION["Polar_Stereographic"],
PARAMETER["latitude_of_origin",60],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
 
whereas outWKT is
 
PROJCS["UTM 32 North (WGS84)",PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],UNIT["Meter",1]]
 
The source GeoTransform matrix is:
- adfGeoTransform 0x0e3eaf58 double [6]
[0] 255106.00000000000 double
[1] 1000.0000000000000 double
[2] 0.00000000000000000 double
[3] -2511133.0000000000 double
[4] 0.00000000000000000 double
[5] -1000.0000000000000 double
 
while after the GDALSuggestedWarpOutput call, the destination
GeoTransform is:
- adfDstGeoTransform,6 0x042bdd18 double [6]
[0] 255106.00000000000 double
[1] 999.99999999999989 double
[2] 0.00000000000000000 double
[3] -2511133.0000000000 double
[4] 0.00000000000000000 double
[5] -999.99999999999989 double
which is a mere copy of the source numbers.
 
As I afterwards specify the transform I want for the warped image:
- adfDstGeoTransform,6 0x042bdd18 double [6]
[0] 330000.00000000000 double
[1] 1000.0000000000000 double
[2] 0.00000000000000000 double
[3] 7280000.0000000000 double
[4] 0.00000000000000000 double
[5] -1000.0000000000000 double
 
...my specified UL-Y [3] (7280000) is pretty far from the suggested
-2511133.
Can this be a cause to my resulting image being empty?
This has been working up to recently, but I have been working on this
code as well as changing the GDAL version.
 
Any ideas?
Best regards,
 
Sjur K :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20081120/3d3eb090/attachment-0001.html


More information about the gdal-dev mailing list