[gdal-dev] near identical files being treated differently

Ken Mankoff mankoff at gmail.com
Mon Jan 23 16:35:48 PST 2023


Hi Even,

Thanks for the explanation.

I'm not clear on what use case your PR supports. I can't gdalwarp the file - the model expects it in its current format. But if QGIS and etc. can now successfully reproject the file for display, that would be nice.

Anyway, now I understand what was happening, and can work around it. I mostly work with the 144x90 file (the one that worked) anyway.

Thank you.

  -k.

On 2023-01-23 at 10:39 -05, Even Rouault <even.rouault at spatialys.com> wrote:
> Ken,
>
> if you do "gdalinfo --debug on GLMELT_4X5.OCN.nc", you'll see
>
> GDAL_netCDF: Latitude/Y is not equally spaced (with a 0.05% tolerance). You may set the
> GDAL_NETCDF_IGNORE_EQUALLY_SPACED_XY_CHECK configuration option to YES to ignore this check
>
> and indeed
>
> $ ncdump -v lat GLMELT_4X5.OCN.nc
> [...]
>  lat = -89, -86, -82, -78, -74, -70, -66, -62, -58, -54, -50, -46, -42, -38,
>     -34, -30, -26, -22, -18, -14, -10, -6, -2, 2, 6, 10, 14, 18, 22, 26, 30,
>     34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 89 ;
>
>
> So you can see the spacing is 4 degree, except for the first and lat
> samples where it is 3. So GDAL cannot report a geotransform matrix for
> such file.
>
> I've just submitted https://github.com/OSGeo/gdal/pull/7113 where GDAL
> will report a GEOLOCATION metadata domain, that can be used by
> gdalwarp to rectify such file
>
> $ gdalinfo autotest/gdrivers/data/netcdf/GLMELT_4X5.OCN.nc
>
> [...]
>
> Geolocation:
>   GEOREFERENCING_CONVENTION=PIXEL_CENTER
>   LINE_OFFSET=0
>   LINE_STEP=1
>   PIXEL_OFFSET=0
>   PIXEL_STEP=1
>   SRS=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"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
>   X_BAND=1
> X_DATASET=NETCDF:"autotest/gdrivers/data/netcdf/GLMELT_4X5.OCN.nc":lon
>   Y_BAND=1
> Y_DATASET=NETCDF:"autotest/gdrivers/data/netcdf/GLMELT_4X5.OCN.nc":lat
>
> Even
>
> Le 23/01/2023 à 13:46, Ken Mankoff a écrit :
>> wgethttps://portal.nccs.nasa.gov/GISS_modelE/modelE_input_data/GLMELT_4X5.OCN.nc
>>
>> wgethttps://portal.nccs.nasa.gov/GISS_modelE/modelE_input_data/GLMELT_144X90_gas.OCN.nc



More information about the gdal-dev mailing list