[gdal-dev] GDALSuggestedWarpOutput returns negative infinity in padfGeoTransformOut

Manuel Massing m.massing at warped-space.de
Mon Aug 2 11:48:54 EDT 2010


Hi Lance,

I suspect the most probable cause for the transform failure is a non-
invertible geotransform matrix in CSTrans (i.e., due to incorrectly set 
scale values).

What are m_srcGT / m_dstGT set to (the 6 actual values, not
the code fragment used to set them)? m_srcGT should be
set to the source file geotransform,  m_dstGT to identity.

You should also add some debug code to see the source and destination
coordinates calculated in CSTrans::STransform, especially if they are
mapped to infinity or all onto the same x/y-coordinate. 

Also, failure of GDALApproxTransform / GDALReprojectionTransform is
not corretly passed on in STransform, so to make sure that it does not 
trip up GDALSuggestedWarpOutput, you should return 0 if GDALApproxTransform or
GDALReprojectionTransform fail (return 0).

cheers,

	Manuel


More information about the gdal-dev mailing list