Skip to content

Commit a2ecbb3

Browse files
authored
improved efficiency in overview proj transform (#519)
1 parent ddf6671 commit a2ecbb3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

worker/gdalprocess/warp.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ int warp_operation_fast(const char *srcFilePath, char *srcProjRef, double *srcGe
188188
srcGeot[4] *= srcYSize / (double)ovrYSize;
189189
srcGeot[5] *= srcYSize / (double)ovrYSize;
190190
191-
void *hOvrTransformArg = GDALCreateGenImgProjTransformer3(srcProjRef, srcGeot, dstProjRef, dstGeot);
192-
if(hOvrTransformArg) {
193-
GDALDestroyGenImgProjTransformer(hTransformArg);
194-
hTransformArg = hOvrTransformArg;
191+
GenImgProjTransformInfo *psInfo = (GenImgProjTransformInfo *)hTransformArg;
192+
memcpy(psInfo->adfSrcGeoTransform, srcGeot,sizeof(psInfo->adfSrcGeoTransform));
193+
if(!GDALInvGeoTransform(psInfo->adfSrcGeoTransform, psInfo->adfSrcInvGeoTransform)) {
194+
GDALDestroyGenImgProjTransformer(psInfo);
195+
GDALClose(hSrcDS);
196+
return 3;
195197
}
196198
}
197199
}

0 commit comments

Comments
 (0)