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
Feature request: workaround regular gridded OISST NetCDF files with no SRS-info #6195
Labels
Comments
here is a another example, again very clearly could detect and assume "OGC:CRS84"
|
I've implented this in https://github.com/mdsumner/gdal/tree/netcdf_6195_assume_longlat
|
I'm so happy about this one, thanks so much! I learnt heaps, your review process is extremely helpful! |
great to have you as the new maintainer of the netCDF driver ! (just kidding... or not ;-)) |
Definitely more contributions to come 😅 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These NetCDF files don't provide a compliant SRS, the OISST files have no “grid_mapping” variable, so GDAL can't auto-determine the coordinate system used by the
sst
,ice
,anom
, anderr
subdatasets.https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/
I obtained an example file (and attached here) from this link
oisst-avhrr-v02r01.20220218.nc.zip
That file is 1.5Mb, zipped only to get around the allowed GH extensions thing.
Steps to reproduce the problem.
gdalsrsinfo NETCDF:"oisst-avhrr-v02r01.20220218.nc":sst ERROR 1: ERROR - failed to load SRS definition from NETCDF:oisst-avhrr-v02r01.20220218.nc:sst
system
I assume GDAL could allow heuristics to provide a fall-back to "OGC:CRS84", because it's clearly basic longitude/latitude grid. I intended to PR this but I get lost in the size of the NetCDF driver, and this might be pretty easy with more experience 🙏
(I also have quite a few examples of similar sources that GDAL could augment by internal logic, so if this is of interest there's quite a range of similar examples for georeferencing and CRS that might fall into categories of similar kinds)
The motivation for us (for interested readers) is to remove augmenting-logic from within R, if GDAL auto-detects this case then we can simplify the code, alternatively we could:
vrt://<dsn>?a_srs=OGC:CRS84
, upcoming in GDAL 3.7.0If the provided files were compliant
To demonstrate the fix required at the provider level, I created a new file.nc that adds the scalar ‘crs’ var with attributes, and this is pointed to by new attributes ‘coordinates’ and ‘grid_mapping’ from the 4D variables that use ‘lon’ and ‘lat’. (I'm not sure if my fix is exactly appropriate in terms of SRS details here)
The modification steps for the repaired file, and more details about communication with the provider are here:
https://github.com/mdsumner/fixoisst
The text was updated successfully, but these errors were encountered: