Skip to content

netcdf: problem grid_mapping and crs params #14822

Description

@mdsumner

Feature description

this is purely a feature request for a garbled file that

  1. has a non-matching grid_mapping name
  2. incorrect central latitude (should be -90) and central longitude (should be 20) - lat_ts is correct -71 presumably
  3. lists EPSG:3031 as an authority, which is clearly not correct

I've stripped it down from the source to make a tiny file with ncks and ncatted (and to anonymize it, but I can share the url if that's of interest)

When GDAL can't find the grid_mapping variable - in this case 'tas:grid_mapping = "Polar Stereographic" ;' it could report that as a warning? It took me a while to realize what was wrong (and confirmed that fixing the values makes the GDAL read correct, so I will report back to the authors).

example netcdf file zipped to pass extension-check here:

tas_broken_grid_mapping.zip

Additional context

netcdf tas_broken_grid_mapping {
dimensions:
        time = UNLIMITED ; // (1 currently)
        y = 14 ;
        x = 15 ;
variables:
        float stereographic ;
                stereographic:missing_value = -1.e+34f ;
                stereographic:_FillValue = -1.e+34f ;
                stereographic:long_name = "Antarctic Polar Stereographic" ;
                stereographic:grid_mapping = "polar_stereographic" ;
                stereographic:standard_name = "polar_stereographic" ;
                stereographic:authority = "EPSG:3031" ;
                stereographic:latitude_of_origin = -71.f ;
                stereographic:central_meridian = 0.f ;
                stereographic:semi_major_axis = 6378137.f ;
                stereographic:inverse_flattening = 298.2572f ;
                stereographic:latitude_of_projection_origin = 90.f ;
                stereographic:false_easting = 0.f ;
                stereographic:false_northing = 0.f ;
        float tas(time, y, x) ;
                tas:missing_value = 1.e+20f ;
                tas:_FillValue = 1.e+20f ;
                tas:long_name = "Near-Surface Air Temperature" ;
                tas:units = "K" ;
                tas:standard_name = "air_temperature" ;
                tas:coordinates = "height" ;
                tas:cell_methods = "time: mean" ;
                tas:grid_mapping = "Polar Stereographic" ;
        double time(time) ;
                time:units = "days since 1949-12-01" ;
                time:axis = "T" ;
                time:calendar = "standard" ;
                time:time_origin = "1-DEC-1949" ;
                time:standard_name = "time" ;
                time:bounds = "time_bnds" ;
        double x(x) ;
                x:units = "km" ;
                x:point_spacing = "even" ;
                x:axis = "X" ;
                x:bounds = "x_bnds" ;
                x:long_name = "x coordinate of projection" ;
                x:standard_name = "projection_x_coordinate" ;
        double y(y) ;
                y:units = "km" ;
                y:point_spacing = "even" ;
                y:axis = "Y" ;
                y:bounds = "y_bnds" ;
                y:long_name = "y coordinate of projection" ;
                y:standard_name = "projection_y_coordinate" ;

// global attributes:
                :Conventions = "CF-1.6" ;
}

Metadata

Metadata

Assignees

Labels

enhancementnot for AI loversSee https://gdal.org/en/stable/community/ai_tool_policy.html

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions