KipCrossing / geotiff

A noGDAL tool for reading and writing geotiff files
GNU Lesser General Public License v2.1
213 stars 23 forks source link

GeoTIFFs not being loaded with tifffile 2022.4.26 #62

Closed Nufflee closed 1 year ago

Nufflee commented 1 year ago

When using tifffile version 2022.4.26 (as specified in the requirements.txt), all GeoTIFF files I tried to load read as NODATA (0 in below example). When I manually update tifffile to 2023.4.12 or newer, the data is being loaded properly. I tried loading these files with tifffile directly and the beahvior was the same for older versions, meaning this is not an issue with this library's code. Additionally, this issue only manifests itself when loading as zarr, if loading to a numpy array, the data is loaded correctly.

The code I used for testing:

from geotiff import GeoTiff
import numpy as np

tiff = GeoTiff('FAA_UTM18N_NAD83.tif')

data = tiff.read()

print(np.mean(data))
tifffile version output
<=2023.3.21 0
>=2023.4.12 202.33013993598698

The used GeoTIFF file can be found here.

mdotter-mitre commented 1 year ago

Also seeing this issue with tifffile version (>=2021.7.2,<2022.4.28) specified in the requirements.txt, but the above fix (upgrading tifffile>=2023.4.12) works.

Please provide an updated requirement.txt