[gdal-dev] python gdal.warp error: The transformation is already "north up"
晓彤
yext0422 at 126.com
Wed Nov 10 18:48:35 PST 2021
Hi all,
I'm working on some MODIS products and try to put them into WGS84 coordinate system after geometric correction. 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:
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
is no affine transformation and no GCPs. Specify transformation option SRC_METHOD=NO_GEOTRANSFORM to bypass this check.
My geometric correction code is like this:
fireData = gdal.Warp(outName4, firemask,
dstSRS = 'EPSG:4326', format = 'GTiff',
resampleAlg = gdal.GRA_Bilinear)
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.
My read data code is as below:
datasets = gdal.Open(fn)
dsSubDatasets = datasets.GetSubDatasets()
firemask = gdal.Open(dsSubDatasets[0][0])
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.
Does anyone have any idea about this error? Thank you for your time and any suggestion is welcomed!
Vera
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20211111/b81e4b68/attachment.html>
More information about the gdal-dev
mailing list