<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<style>
font{
line-height: 1.6;
}
ul,ol{
padding-left: 20px;
list-style-position: inside;
}
</style>
<div style="font-family:微软雅黑,Verdana,"Microsoft Yahei",SimSun,sans-serif;font-size:14px; line-height:1.6;">
<div></div><div>
<div>Hi all,</div><div><span style="line-height: 1.6;">I'm working on some MODIS products and try to put them into WGS84 coordinate system after geometric correction. </span><span style="line-height: 1.6;">I used gdal.warp to process satellite image in form of HDF files(eg. MODIS fire product MOD14, MODIS aerosol product MOD04), but it threw an error which I was unable to fix:</span></div><div>The transformation is already "north up" or a transformation between pixel/line and georeferenced coordinates cannot be computed for HDF4_SDS:UNKNOWN:"MOD14.A2010182.0625.061.2021162192551.hdf":0. There
<br>is no affine transformation and no GCPs. Specify transformation option SRC_METHOD=NO_GEOTRANSFORM to bypass this check.</div>
<div><br></div><div>My geometric correction code is like this:</div><div><br></div><div><span style="color: rgb(0, 0, 0); font-size: 14px;"> fireData = gdal.Warp(outName4, firemask,</span></div><div><div><span style="color: rgb(0, 0, 0); font-size: 14px;"> dstSRS = 'EPSG:4326', format = 'GTiff',</span></div><div><span style="color: rgb(0, 0, 0); font-size: 14px;"> resampleAlg = gdal.GRA_Bilinear)</span></div><div><span style="color: rgb(0, 0, 0); font-size: 14px; background-color: rgb(255, 255, 255);"><br></span></div><div><span style="color: rgb(0, 0, 0); font-size: 14px; background-color: rgb(255, 255, 255);">The same code works when 'firemask' is read from MOD04 hdf files, but as long as I change the input raster from MOD14 hdf files, it throws an error like above.</span><br></div></div><div><br></div><div>My read data code is as below:</div><div><div style="color: rgb(212, 212, 212); font-family: Consolas, 'Courier New', monospace; line-height: 19px; white-space: pre; background-color: rgb(30, 30, 30);"><div><span style="color: #9cdcfe;">datasets</span> = <span style="color: #4ec9b0;">gdal</span>.<span style="color: #dcdcaa;">Open</span>(<span style="color: #9cdcfe;">fn</span>)</div><div><span style="color: #9cdcfe;">dsSubDatasets</span> = <span style="color: #9cdcfe;">datasets</span>.GetSubDatasets()</div><div><div><span style="color: #9cdcfe;">firemask</span> = <span style="color: #4ec9b0;">gdal</span>.<span style="color: #dcdcaa;">Open</span>(<span style="color: #9cdcfe;">dsSubDatasets</span>[<span style="color: #b5cea8;">0</span>][<span style="color: #b5cea8;">0</span>])</div></div></div></div><div><br></div><div>As I tried to figure out this problem, I can't fine any parameter named "SRC_METHOD" in python gdal. Then I checked the metadata of MOD14 hdf file, it doesn't contain any coordinate system information.</div><div><br></div><div>Does anyone have any idea about this error? Thank you for your time and any suggestion is welcomed!</div><div><br></div><div>Vera</div><div><span style="color: rgb(0, 0, 0); font-size: 14px; background-color: rgb(255, 255, 255);"><br></span></div><div><br></div>
</div><!--😀-->
</div>
</body>
</html>