Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug calculating landsat angles #28

Closed
gillins opened this issue Nov 12, 2019 · 4 comments
Closed

A bug calculating landsat angles #28

gillins opened this issue Nov 12, 2019 · 4 comments
Labels
bug Something isn't working major

Comments

@gillins
Copy link
Member

gillins commented Nov 12, 2019

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.

@gillins
Copy link
Member Author

gillins commented Nov 12, 2019

Original comment by Neil Flood (Bitbucket: neilflood, GitHub: neilflood).


That line of code is correct. I cannot reproduce this.

If there is an error further down, we should find it, but the order of values in that tuple is correct as it is.

@gillins gillins added major bug Something isn't working labels Nov 13, 2019
@bnucaowu
Copy link

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)
image
In my case, the older values in that tuple is wrong.

@neilflood
Copy link
Member

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 OSGeo/gdal#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.

@neilflood neilflood reopened this Dec 16, 2019
@neilflood
Copy link
Member

With release 1.4.10 of rios, this now works correctly with GDAL 3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

3 participants