id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 5980,GDALWarp Geolocation Failed,liminlu0314,warmerdam,"GDAL will fail when performing Geolocation warp to the data in the attachment. The error occurs in the file ""alg\gdaltransformer.cpp"", line 703~706, when GDALSuggestedWarpOut2 function is calculating the size of output image. The original code: {{{ if( pabSuccess[0] && pabSuccess[nSamplePoints - 1] ) { dfDeltaX = padfX[nSamplePoints-1] - padfX[0]; dfDeltaY = padfY[nSamplePoints-1] - padfY[0]; } }}} when the coordinates of the first point(0) and the last point(nSamplePoints-1) are equal, dfDeltaX and dfDeltaY will both be zero, leading to the calculation error of output image size. This can be solved by the following codes: {{{ if( pabSuccess[0] && pabSuccess[nSamplePoints - 1] ) { dfDeltaX = padfX[nSamplePoints-1] - padfX[0]; dfDeltaY = padfY[nSamplePoints-1] - padfY[0]; if(dfDeltaX == 0 || dfDeltaY == 0) { dfDeltaX = dfMaxXOut - dfMinXOut; dfDeltaY = dfMaxYOut - dfMinYOut; } } }}} Accessories for the test data, using gdalwarp tools for testing: {{{ gdalwarp.exe -geoloc H2A_SM2B20130716_09026.vrt H2A_SM2B20130716_09026.tif }}} H2A_SM2B20130716_09026.h5 is original data; H2A_SM2B20130716_09026.vrt is virtual data to construct containing Geolocation metadata; H2A_SM2B20130716_09026.tif is correct warp data. ",defect,closed,normal,1.11.3,Algorithms,1.11.2,normal,fixed,"Gdalwarp,geoloc",