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.57k stars 3k forks source link

Unable to open .bag / .hdf5 file in every QGIS release after 3.4 (Windows) #33229

Closed rossoe closed 4 years ago

rossoe commented 4 years ago

Describe the bug This was initially posted against GDAL ticket - https://github.com/OSGeo/gdal/issues/1428

But posting here in case it's an issue of the version of HDF5 that is currently compiled and baked into more recent QGIS releases? Quick fixes on the GDAL github point to recompile getting around the issue, but at my company we can't carry out recompile due to security restrictions.

How to Reproduce

Example .bag file to test: https://data.ngdc.noaa.gov/platforms/ocean/nos/coast/H12001-H14000/H12656/BAG/H12656_MB_50cm_MLLW_27of31.bag

Start QGIS - Top Menu > Layer > Data Source Manager Add layer via Raster selection

Fails with following error:

Invalid Layer: GDAL provider Cannot open GDAL dataset

C:\Users\rosso\Downloads\H12656_MB_50cm_MLLW_27of31.bag: C:\Users\rosso\Downloads\H12656_MB_50cm_MLLW_27of31.bag' not recognized as a supported file format. Raster layer Provider is not valid (provider: gdal, URI: C:\Users\rosso\Downloads\H12656_MB_50cm_MLLW_27of31.bag

Also attempted by running command via python console:

os.system(r'''gdal_translate -of AAIGrid E:/Users/rosso/GIS/GlobalMapper/H12656_MB_50cm_MLLW_27of31.bag E:/Users/rosso/GIS/GlobalMapper/final.asc''')

But that fails to run & console spits out:

HDF5-DIAG: Error detected in HDF5 (1.10.4) thread 0:

000: C:\src\osgeo4w\hdf5\src\H5P.c line 253 in H5Pcreate(): not a property list class

major: Invalid arguments to routine minor: Inappropriate type HDF5-DIAG: Error detected in HDF5 (1.10.4) thread 0:

000: C:\src\osgeo4w\hdf5\src\H5Pfapl.c line 829 in H5Pset_driver(): not a property list

major: Invalid arguments to routine minor: Inappropriate type HDF5-DIAG: Error detected in HDF5 (1.10.4) thread 0:

000: C:\src\osgeo4w

Tried to run via Raster 'Translate' QGIS GUI:

_core.QgsProcessingException: Could not load source layer for INPUT: E:/Users/rosso/GIS/GlobalMapper/2006 HI1156 Hampstead Ledge to Stansore Point 2m SB.bag not found Traceback (most recent call last): File "F:/OSGEO41/apps/qgis/./python/plugins\processing\algs\gdal\GdalAlgorithmDialog.py", line 140, in parametersHaveChanged commands = self.alg.getConsoleCommands(parameters, context, feedback, executing=False) File "F:/OSGEO41/apps/qgis/./python/plugins\processing\algs\gdal\translate.py", line 120, in getConsoleCommands raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT)) _core.QgsProcessingException: Could not load source layer for INPUT: E:/Users/rosso/GIS/GlobalMapper/2006 HI1156 Hampstead Ledge to Stansore Point 2m SB.bag not found

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] QGIS version: 3.6.1-Noosa Noosa, 24682 26bc9

Python Path: F:/OSGEO41/apps/qgis/./python C:/Users/rosso/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\qgis-plugins\qgis-otb-plugin C:/Users/rosso/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins F:/OSGEO41/apps/qgis/./python/plugins F:\OSGeo4W64\bin\python37.zip F:\OSGEO41\apps\Python37\DLLs F:\OSGEO41\apps\Python37\lib F:\OSGeo4W64\bin F:\OSGEO41\apps\Python37 F:\OSGEO41\apps\Python37\lib\site-packages F:\OSGEO41\apps\Python37\lib\site-packages\win32 F:\OSGEO41\apps\Python37\lib\site-packages\win32\lib F:\OSGEO4~1\apps\Python37\lib\site-packages\Pythonwin C:/Users/rosso/AppData/Roaming/QGIS/QGIS3\profiles\default/python

QGIS and OS versions

Above was tested against QGIS 3.6.1 on Win 10

But also having same issue on below version

QGIS version
3.10.0-A Coruña
QGIS code revision
6c816b4204
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
2.4.1
Running against GDAL/OGR
2.4.1
Compiled against GEOS
3.8.0-CAPI-1.13.1
Running against GEOS
3.8.0-CAPI-1.13.1 
Compiled against SQLite
3.29.0
Running against SQLite
3.29.0
PostgreSQL Client Version
11.5
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
5.2.0
Running against PROJ
Rel. 5.2.0, September 15th, 2018
OS Version
Windows Server 2016 (10.0)
Active python plugins
Qgis2threejs; 
quick_map_services; 
db_manager; 
MetaSearch; 
processing
gioman commented 4 years ago

@rossoe maybe is a problem in GDAL 3?

In my linux box with GDAL 2.2.3

gdalinfo H12656_MB_50cm_MLLW_27of31.bag 
ERROR 1: projection =  not recognised by ISO 19115 parser.
Driver: BAG/Bathymetry Attributed Grid
Files: H12656_MB_50cm_MLLW_27of31.bag
Size is 1435, 382
Coordinate System is:
PROJCS["UTM Zone 16, Northern Hemisphere",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-87],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
Origin = (406260.737960783473682,3328796.789747148752213)
Pixel Size = (0.500348675034867,-0.501312335958005)
Metadata:
  BagVersion=1.5.1
  BAG_DATETIME=
Corner Coordinates:
Upper Left  (  406260.738, 3328796.790) ( 87d58'21.87"W, 30d 5'12.29"N)
Lower Left  (  406260.738, 3328605.288) ( 87d58'21.81"W, 30d 5' 6.07"N)
Upper Right (  406978.738, 3328796.790) ( 87d57'55.05"W, 30d 5'12.49"N)
Lower Right (  406978.738, 3328605.288) ( 87d57'54.99"W, 30d 5' 6.27"N)
Center      (  406619.738, 3328701.039) ( 87d58' 8.43"W, 30d 5' 9.28"N)
Band 1 Block=1435x1 Type=Float32, ColorInterp=Undefined
  Description = elevation
  Min=-19.315 Max=-17.532 
  NoData Value=1000000
Band 2 Block=1435x1 Type=Float32, ColorInterp=Undefined
  Description = uncertainty
  Min=0.470 Max=1.079 
  NoData Value=1000000

and it loads fine in QGIS.

rossoe commented 4 years ago

Hi Gioman, Yes a few people on GDAL github thread noted that it's fine on Linux, this problem only hits QGIS running under good old Windows!

gioman commented 4 years ago

this problem only hits QGIS running under good old Windows!

I would say it affects GDAL on Windows, not QGIS.

sbahtiyar commented 4 years ago

this problem only hits QGIS running under good old Windows!

I would say it affects GDAL on Windows, not QGIS.

It is not a problem of GDAL on Windows or GDAL 3. I have a separate installation of GDAL 3 on Windows and it works fine.

On the other hand, GDAL installation that comes with QGIS is not able to open hdf5 files. This situation is tested with QGIS 3.4(GDAL 2.x) , QGIS 3.8(GDAL 2.x) and QGIS 3.10(GDAL 3).

jef-n commented 4 years ago

On the other hand, GDAL installation that comes with QGIS is not able to open hdf5 files. This situation is tested with QGIS 3.4(GDAL 2.x) , QGIS 3.8(GDAL 2.x) and QGIS 3.10(GDAL 3).

3.8 is EOL. 3.10.1 and 3.4.14?

sbahtiyar commented 4 years ago

On the other hand, GDAL installation that comes with QGIS is not able to open hdf5 files. This situation is tested with QGIS 3.4(GDAL 2.x) , QGIS 3.8(GDAL 2.x) and QGIS 3.10(GDAL 3).

3.8 is EOL. 3.10.1 and 3.4.14?

3.4.14(LTR) and 3.10.0-2