qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.37k stars 2.98k forks source link

GeoTiff does not show in when it has north-up geotransform without SRS attached #39478

Open idanmiara opened 3 years ago

idanmiara commented 3 years ago

Describe the bug

I'm trying to load in QGIS the attached 24KB simple single byte raster (for debugging gdal_calc.py). I zoom to extent and I see nothing, when I try to click on it with the "Identify features" tool it shows nothing. I've also tried to add a grayscale color_table and translate to RGB and add geotransform and srs - still doesn't show. Both seem valid, and have a non trivial histogram. Both load fine in some picture viewers that I've tried, ms-paint, for instance. The histogram computed in QGIS also looks fine.

I'm attaching both samples. The following output has the same band checksum as the raster test_gdal_calc_py_1_2.tif from test1 Here is the rgb raster with gt and srs

@timlinux kindly confirmed: gdal_translate test_gdal_calc_py_9_1.tif -colorinterp red -of PNG test.png - shows in QGIS gdal_translate test_gdal_calc_py_9_1.tif -colorinterp red -of GTIFF test.tif - doesn't show in QGIS

How to Reproduce

load any of the attached samples to QGIS.

QGIS and OS versions

2.18, 3.14 Win64

gdalinfo gdalinfo -hist test_gdal_calc_py_9_1.tif

Driver: GTiff/GeoTIFF Files: d:\dev\gis\gdal1\autotest\pyscripts\tmp\test_gdal_calc_py_9_1.tif Size is 162, 150 Origin = (0.000000000000000,0.000000000000000) Pixel Size = (1.000000000000000,1.000000000000000) Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 0.0000000, 0.0000000) Lower Left ( 0.000, 150.000) Upper Right ( 162.0000000, 0.0000000) Lower Right ( 162.000, 150.000) Center ( 81.0000000, 75.0000000) Band 1 Block=162x50 Type=Byte, ColorInterp=Gray 0...10...20...30...40...50...60...70...80...90...100 - done. 256 buckets from -0.5 to 255.5: 16777 819 118 48 4 7 12 76 159 156 120 122 140 111 104 95 88 91 95 81 68 93 66 66 81 57 72 61 70 69 68 59 69 88 60 56 38 69 58 56 55 54 52 62 61 51 51 36 46 43 42 47 52 48 32 50 42 32 44 33 34 39 29 36 20 24 26 26 24 18 35 24 32 34 35 39 44 28 28 29 31 34 30 22 30 18 18 28 28 20 21 19 21 31 17 27 17 19 25 22 19 17 17 11 13 18 16 16 15 17 21 12 7 19 12 17 12 15 21 13 13 17 11 11 13 13 13 15 10 15 15 17 8 11 7 7 9 11 10 8 10 12 11 8 7 5 10 5 5 6 5 9 12 3 6 9 6 8 7 7 11 6 8 9 7 10 1 4 6 6 7 7 4 6 5 6 3 12 6 3 3 6 9 6 3 5 7 8 1 2 2 2 3 4 4 5 3 4 3 2 3 2 3 1 5 5 2 3 3 5 3 4 2 2 2 5 3 5 2 3 4 2 8 5 5 10 3 3 4 3 4 7 2 7 4 9 9 16 18 13 13 7 23 17 20 22 51 77 51 45 37 45 40 56 68 0 NoData Value=255

idanmiara commented 3 years ago

@rouault suggested the root of this problem

Pedro-Murteira commented 2 years ago

Still valid on QGIS 3.22.3. (Windows 10)