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

NetCDF file crashing on load (UTM projection with grid_mapping) #25266

Closed
qgib opened this issue Oct 31, 2017 · 2 comments
Closed

NetCDF file crashing on load (UTM projection with grid_mapping) #25266

qgib opened this issue Oct 31, 2017 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Rasters Related to general raster layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Oct 31, 2017

Author Name: Alan Snow (@snowman2)
Original Redmine Issue: 17369
Affected QGIS version: 2.18.13
Redmine category:rasters


QGIS closes completely when opening the file without saying why.

It opens fine with GDAL and xarray.

NCDUMP:

netcdf state1km_simple {
dimensions:
	x = 1535 ;
	y = 790 ;
variables:
	double x(x) ;
		x:_FillValue = NaN ;
	double y(y) ;
		y:_FillValue = NaN ;
	int64 spatial_ref ;
		spatial_ref:spatial_ref = "PROJCS[\"UTM Zone 15, Northern Hemisphere\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-93],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]" ;
		spatial_ref:crs_wkt = "PROJCS[\"UTM Zone 15, Northern Hemisphere\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-93],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]" ;
	int64 time ;
		time:long_name = "time" ;
		time:standard_name = "time" ;
		time:units = "days since 2017-10-18 00:00:00" ;
		time:calendar = "proleptic_gregorian" ;
	double state_1km_1_MYD09GA(y, x) ;
		state_1km_1_MYD09GA:_FillValue = 65535. ;
		state_1km_1_MYD09GA:long_name = "1km Reflectance Data State QA - first layer" ;
		state_1km_1_MYD09GA:units = "bit field" ;
		state_1km_1_MYD09GA:valid_range = 0US, 57335US ;
		state_1km_1_MYD09GA:Nadir\ Data\ Resolution = "1km" ;
		state_1km_1_MYD09GA:QA\ index = "\n\tBits are listed from the MSB (bit 15) to the LSB (bit 0):\n\tBit    Description\n\t15     internal snow algorithm flag; \n\t       1 -- yes, 0.00%\n\t       0 -- no, 100.00%\n\t14     Salt Pan;\n\t       1 -- yes, 0.00%\n\t       0 -- no, 100.00%\n\t13     Pixel is adjacent to cloud;\n\t       1 -- yes, 5.13%\n\t       0 -- no, 94.87%\n\t12     MOD35 snow/ice flag;\n\t       1 -- yes, 0.00%\n\t       0 -- no, 100.00%\n\t11     internal fire algorithm flag;\n\t       1 -- fire, 0.01%\n\t       0 -- no fire, 99.99%\n\t10     internal cloud algorithm flag;\n\t       1 -- cloud, 17.43%\n\t       0 -- no cloud, 82.57%\n\t8-9    cirrus detected;\n\t       00 -- none, 84.24%\n\t       01 -- small, 1.14%\n\t       10 -- average, 2.51%\n\t       11 -- high, 12.10%\n\t6-7    aerosol quantity;\n\t       00 -- climatology, 20.49%\n\t       01 -- low, 75.85%\n\t       10 -- average, 3.21%\n\t       11 -- high, 0.45%\n\t3-5    land/water flag;\n\t       000 -- shallow ocean, 0.00%\n\t       001 -- land, 73.22%\n\t       010 -- ocean coastlines and lake shorelines, 16.48%\n\t       011 -- shallow inland water, 9.42%\n\t       100 -- ephemeral water, 0.00%\n\t       101 -- deep inland water, 0.88%\n\t       110 -- continental/moderate ocean, 0.00%\n\t       111 -- deep ocean, 0.00%\n\t2      cloud shadow;\n\t       1 -- yes, 1.90%\n\t       0 -- no, 98.10%\n\t0-1    cloud state;\n\t       00 -- clear, 82.64%\n\t       01 -- cloudy, 8.20%\n\t       10 -- mixed, 9.17%\n\t       11 -- not set, assumed clear, 0.00%\n" ;
		state_1km_1_MYD09GA:crs = "+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs " ;
		state_1km_1_MYD09GA:res = 1557.11016872989, 1557.11016872989 ;
		state_1km_1_MYD09GA:is_tiled = 0UB ;
		state_1km_1_MYD09GA:transform = 1557.11016872989, 0., -635816.960644528, 0., -1557.11016872989, 5660204.61915843 ;
		state_1km_1_MYD09GA:spatial_ref = "PROJCS[\"UTM Zone 15, Northern Hemisphere\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",-93],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]" ;
		state_1km_1_MYD09GA:nodata = 65535. ;
		state_1km_1_MYD09GA:raster_dataset = "MODIS" ;
		state_1km_1_MYD09GA:raster_source = "MYD09GA" ;
		state_1km_1_MYD09GA:grid_mapping = "spatial_ref" ;

// global attributes:
		:coordinates = "time" ;
}

gdalinfo

gdalinfo state1km_simple.nc 
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Driver: netCDF/Network Common Data Format
Files: state1km_simple.nc
Size is 1535, 790
Coordinate System is:
PROJCS["UTM Zone 15, Northern Hemisphere",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-93],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
Origin = (-636596.023261542082764,5660984.161004629917443)
Pixel Size = (1558.125234028933164,-1559.083692391145632)
Metadata:
  NC_GLOBAL#coordinates=time
  spatial_ref#crs_wkt=PROJCS["UTM Zone 15, Northern Hemisphere",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
  spatial_ref#spatial_ref=PROJCS["UTM Zone 15, Northern Hemisphere",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
  state_1km_1_MYD09GA#crs=+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs 
  state_1km_1_MYD09GA#grid_mapping=spatial_ref
  state_1km_1_MYD09GA#is_tiled=0
  state_1km_1_MYD09GA#long_name=1km Reflectance Data State QA - first layer
  state_1km_1_MYD09GA#Nadir Data Resolution=1km
  state_1km_1_MYD09GA#nodata=65535
  state_1km_1_MYD09GA#QA index=
	Bits are listed from the MSB (bit 15) to the LSB (bit 0):
	Bit    Description
	15     internal snow algorithm flag; 
	       1 -- yes, 0.00%
	       0 -- no, 100.00%
	14     Salt Pan;
	       1 -- yes, 0.00%
	       0 -- no, 100.00%
	13     Pixel is adjacent to cloud;
	       1 -- yes, 5.13%
	       0 -- no, 94.87%
	12     MOD35 snow/ice flag;
	       1 -- yes, 0.00%
	       0 -- no, 100.00%
	11     internal fire algorithm flag;
	       1 -- fire, 0.01%
	       0 -- no fire, 99.99%
	10     internal cloud algorithm flag;
	       1 -- cloud, 17.43%
	       0 -- no cloud, 82.57%
	8-9    cirrus detected;
	       00 -- none, 84.24%
	       01 -- small, 1.14%
	       10 -- average, 2.51%
	       11 -- high, 12.10%
	6-7    aerosol quantity;
	       00 -- climatology, 20.49%
	       01 -- low, 75.85%
	       10 -- average, 3.21%
	       11 -- high, 0.45%
	3-5    land/water flag;
	       000 -- shallow ocean, 0.00%
	       001 -- land, 73.22%
	       010 -- ocean coastlines and lake shorelines, 16.48%
	       011 -- shallow inland water, 9.42%
	       100 -- ephemeral water, 0.00%
	       101 -- deep inland water, 0.88%
	       110 -- continental/moderate ocean, 0.00%
	       111 -- deep ocean, 0.00%
	2      cloud shadow;
	       1 -- yes, 1.90%
	       0 -- no, 98.10%
	0-1    cloud state;
	       00 -- clear, 82.64%
	       01 -- cloudy, 8.20%
	       10 -- mixed, 9.17%
	       11 -- not set, assumed clear, 0.00%

  state_1km_1_MYD09GA#raster_dataset=MODIS
  state_1km_1_MYD09GA#raster_source=MYD09GA
  state_1km_1_MYD09GA#res={1557.110168729891,1557.110168729891}
  state_1km_1_MYD09GA#spatial_ref=PROJCS["UTM Zone 15, Northern Hemisphere",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
  state_1km_1_MYD09GA#transform={1557.110168729891,0,-635816.9606445276,0,-1557.110168729891,5660204.619158435}
  state_1km_1_MYD09GA#units=bit field
  state_1km_1_MYD09GA#valid_range={0,57335}
  state_1km_1_MYD09GA#_FillValue=65535
  x#_FillValue=nan
  y#_FillValue=nan
Corner Coordinates:
Upper Left  ( -636596.023, 5660984.161) (108d53'50.95"W, 50d 0' 3.98"N)
Lower Left  ( -636596.023, 4429308.044) (106d 9' 8.17"W, 39d15'45.92"N)
Upper Right ( 1755126.211, 5660984.161) ( 75d31'19.72"W, 49d46' 1.08"N)
Lower Right ( 1755126.211, 4429308.044) ( 78d30'54.69"W, 39d 6' 5.62"N)
Center      (  559265.094, 5045146.103) ( 92d14'26.35"W, 45d33'26.39"N)
Band 1 Block=1535x1 Type=Float64, ColorInterp=Undefined
  NoData Value=65535
  Unit Type: bit field
  Metadata:
    crs=+proj=utm +zone=15 +datum=WGS84 +units=m +no_defs 
    grid_mapping=spatial_ref
    is_tiled=0
    long_name=1km Reflectance Data State QA - first layer
    Nadir Data Resolution=1km
    NETCDF_VARNAME=state_1km_1_MYD09GA
    nodata=65535
    QA index=
	Bits are listed from the MSB (bit 15) to the LSB (bit 0):
	Bit    Description
	15     internal snow algorithm flag; 
	       1 -- yes, 0.00%
	       0 -- no, 100.00%
	14     Salt Pan;
	       1 -- yes, 0.00%
	       0 -- no, 100.00%
	13     Pixel is adjacent to cloud;
	       1 -- yes, 5.13%
	       0 -- no, 94.87%
	12     MOD35 snow/ice flag;
	       1 -- yes, 0.00%
	       0 -- no, 100.00%
	11     internal fire algorithm flag;
	       1 -- fire, 0.01%
	       0 -- no fire, 99.99%
	10     internal cloud algorithm flag;
	       1 -- cloud, 17.43%
	       0 -- no cloud, 82.57%
	8-9    cirrus detected;
	       00 -- none, 84.24%
	       01 -- small, 1.14%
	       10 -- average, 2.51%
	       11 -- high, 12.10%
	6-7    aerosol quantity;
	       00 -- climatology, 20.49%
	       01 -- low, 75.85%
	       10 -- average, 3.21%
	       11 -- high, 0.45%
	3-5    land/water flag;
	       000 -- shallow ocean, 0.00%
	       001 -- land, 73.22%
	       010 -- ocean coastlines and lake shorelines, 16.48%
	       011 -- shallow inland water, 9.42%
	       100 -- ephemeral water, 0.00%
	       101 -- deep inland water, 0.88%
	       110 -- continental/moderate ocean, 0.00%
	       111 -- deep ocean, 0.00%
	2      cloud shadow;
	       1 -- yes, 1.90%
	       0 -- no, 98.10%
	0-1    cloud state;
	       00 -- clear, 82.64%
	       01 -- cloudy, 8.20%
	       10 -- mixed, 9.17%
	       11 -- not set, assumed clear, 0.00%

    raster_dataset=MODIS
    raster_source=MYD09GA
    res={1557.110168729891,1557.110168729891}
    spatial_ref=PROJCS["UTM Zone 15, Northern Hemisphere",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-93],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
    transform={1557.110168729891,0,-635816.9606445276,0,-1557.110168729891,5660204.619158435}
    units=bit field
    valid_range={0,57335}
    _FillValue=65535


@qgib
Copy link
Contributor Author

qgib commented Nov 1, 2017

Author Name: Alan Snow (@snowman2)


I realized that I had two versions of GDAL.

  • I had GDAL 1.11 on my Ubuntu machine, and it is not compatible with the NetCDF file. GDAL had a core dump when performing gdalinfo.

  • I installed from the ubuntugis repos and have GDAL 2.2.1 with QGIS 2.18.14 and it works with the example NetCDF file.


  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Nov 1, 2017
@qgib
Copy link
Contributor Author

qgib commented Nov 2, 2017

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from to invalid

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Rasters Related to general raster layer handling (not specific data formats) Crash/Data Corruption labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Rasters Related to general raster layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant