Bug report #21783

Error reading netCDF with multiple bands

Added by giu mas over 5 years ago. Updated over 5 years ago.

Status:Open
Priority:High
Assignee:-
Category:Rasters
Affected QGIS version:3.7(master) Regression?:Yes
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29598

Description

I am creating some netCDF files with more than 1 band using GDAL (2.4.1).

The created files (an example file in attachment) works fine in QGIS 2.18 (and other GIS apps), but I get the following errors with QGIS 3+ (ltr, dev, etc.) on OSGEO4W64:

2019-04-07T16:16:16     CRITICAL    Invalid Layer : Raster layer Provider is not valid (provider: gdal, URI: C:/gdal.nc
2019-04-07T16:16:16     CRITICAL    Invalid Data Source : C:/gdal.nc is not a valid or recognized data source.

If I create a netCDF file with just 1 band (example attached), QGIS 3+ reads the file smoothly.

This issue may be related to #20921, #20980 and #21648

gdal_3bands.nc - Example file NOT working on QGIS 3+ (229 KB) giu mas, 2019-04-07 10:21 PM

gdal_1band.nc - Example file WORKING on QGIS 3+ (79.1 KB) giu mas, 2019-04-07 10:21 PM

qgis-bin_2019-04-09_00-22-03.png - QGIS error (44.4 KB) giu mas, 2019-04-09 06:22 AM

osgeolive12_qgis-dev.png - QGIS error on Ubuntu (1010 KB) giu mas, 2019-04-09 07:18 PM

osgeolive12_qgis_about.png - QGIS about on Ubuntu (63.7 KB) giu mas, 2019-04-09 07:40 PM

osgeo4w64_qgis_about.png - QGIS about on Windows 10 (27.6 KB) giu mas, 2019-04-09 07:44 PM


Related issues

Related to QGIS Application - Bug report #21822: Cannot load multivariable netcdf files Open 2019-04-10

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

it works as expected here: when you d&d the 3 band raster on the canvas a dialog shows asking what band you want to load. You must select at least one. If you don't select any band then you gets the error.

#2 Updated by giu mas over 5 years ago

I have attempted the same process (d&d the 3 band raster) on different Windows machines.

The result is always the same error (screenshot attached).

Are you running QGIS as it comes from OSGEO4W64? Or do you have active some dev-specific settings? This would explain why it works on your machine.

QGIS error

#3 Updated by Giovanni Manghi over 5 years ago

  • Priority changed from Normal to High
  • Status changed from Open to Feedback

giu mas wrote:

I have attempted the same process (d&d the 3 band raster) on different Windows machines.

I tried on Linux (Ubuntu 18.04). You should also do (I can't test on Windows right now), so we can say if the problem is platform dependent.
It could also depend on the version of GDAL being used.

#4 Updated by giu mas over 5 years ago

My Ubuntu 18.04 steps:

- Download the latest OSGeoLive (12) VM.
- Update the software repositories with https://qgis.org/ubuntu-nightly.
- Install QGIS: sudo apt-get install qgis python3-qgis qgis-plugin-grass
- Drag and drop gdal_3bands.nc.

Unfortunately, I got the same error:

QGIS error on Ubuntu

#5 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

Unfortunately, I got the same error (attached).

what is the GDAL version used (you see it in the QGIS "about")?

#6 Updated by giu mas over 5 years ago

2.2.3 on Ubuntu

QGIS about on Ubuntu

#7 Updated by giu mas over 5 years ago

2.4.0 on Windows

QGIS about on Windows 10

#8 Updated by Jürgen Fischer over 5 years ago

  • Description updated (diff)

#9 Updated by Giovanni Manghi over 5 years ago

  • Subject changed from Error in reading netCDF with multiple bands to Error in reading netCDF with multiple bands on Windows

Yeah I can see it on Windows... but on Linux definitely works here.

#10 Updated by giu mas over 5 years ago

Mmm... I disagree since it does not work on my OSGeolive VM (I can share the VM with you).

Furthermore, there are tickets on potentially the same issue:
  • #20921 (got closed for lack of feedback) on Linux
  • #21648 (waiting for feedback) on Mac

#11 Updated by Giovanni Manghi over 5 years ago

giu mas wrote:

Mmm... I disagree since it does not work on my OSGeolive VM (I can share the VM with you).

I can download myself if needed.

Furthermore, there are tickets on potentially the same issue:
  • #20921 (got closed for lack of feedback) on Linux
  • #21648 (waiting for feedback) on Mac

just saying that on my linux box(es), with that gdal version, it works.

#12 Updated by giu mas over 5 years ago

Giovanni Manghi wrote:

giu mas wrote:

Mmm... I disagree since it does not work on my OSGeolive VM (I can share the VM with you).

I can download myself if needed.

My VM would have the issue that I am talking about. The default OSGeolive has QGSI 2.18, thus I have installed in it QGIS 3-dev (I have described my steps in a previous post.)

Furthermore, there are tickets on potentially the same issue:
  • #20921 (got closed for lack of feedback) on Linux
  • #21648 (waiting for feedback) on Mac

just saying that on my linux box(es), with that gdal version, it works.

I am only afraid that the title modification implies that the issue has been identified as Windows-only. In reality, there is evidence of the contrary after that I have followed your suggestion to run QGIS 3-dev on Linux.

#13 Updated by Jürgen Fischer over 5 years ago

#14 Updated by Giovanni Manghi over 5 years ago

  • Subject changed from Error in reading netCDF with multiple bands on Windows to Error reading netCDF with multiple bands

Also available in: Atom PDF