Closed gillins closed 4 years ago
from rios import fileinfo import numpy file = "/home/LC80420082013220LGN00_B1_toa.TIF" imgInfo = fileinfo.ImageInfo(file) cornerLatLong = imgInfo.getCorners(outEPSG=4326) (ul_lat, ul_long, ur_lat, ur_long, lr_lat, lr_long, ll_lat, ll_long) = cornerLatLong # changed pts = numpy.array([ ... [ul_long, ul_lat], ... [ur_long, ur_lat], ... [ll_long, ll_lat], ... [lr_long, lr_lat] ... ]) longDeg = pts[:, 0] latDeg = pts[:, 1] longDeg array([-98.41048362, -89.37133398, -97.6997143 , -89.84929715]) latDeg array([74.60575466, 74.64178368, 72.2106416 , 72.2415592 ]) cornerLatLong (74.60575466167826, -98.41048362112267, 74.64178367907462, -89.37133397624285, 72.24155919861137, -89.84929715401962, 72.21064160380321, -97.69971430154234) In my case, the older values in that tuple is wrong.
After some further investigation, it appears that this occurs when using GDAL-3.x. Furthermore, it seems that this is a deliberate change in the behaviour of GDAL, which everyone is now going to have to cope with. See https://github.com/OSGeo/gdal/issues/1546.
We will have to work out the best approach to dealing with this. Until then, nothing will work with GDAL-3.x.
Thank you for bringing it to our attention.
With release 1.4.10 of rios, this now works correctly with GDAL 3.x
Original report by Anonymous.
The function sunAnglesForExtent in landsatangls.py
Line 227 Original code : (ul_long, ul_lat, ur_long, ur_lat, lr_long, lr_lat, ll_long, ll_lat) = cornerLatLong
Changed code : (ul_lat, ul_long, ur_lat, ur_long, lr_lat, lr_long, ll_lat, ll_long) = cornerLatLong
Then the output : angle map is correct.