Trying to use any of the projection functions of a GridCoordSystem (like findXYindexFromLatLon) on a file with lambert confomal projection (or potentially other projections too, I have not tested this however) can result in incorrect coordinates being returned, as the projection functions don't respect the units of the dataset.
In particular, the issue is the hardcoded earth radius, which is given in km by default. However, this does not get converted when the dataset's false northing/easting values are not given in km.
Because of this mismatch of units, the results of the projection functions are always incorrect.
Example datasets where this happens are available from GeoSphere Austria/ZAMG for instance (INCA weather model): ftp://eaftp.zamg.ac.at/nowcast. These files have their false northing/easting given in meters instead of km, which breaks the projection calculations of netcdf-java.
Fix: Check the dataset's units and accordingly convert the earth radius to those units when initializing the GridCoordSystem.
Relevant stack trace
No response
Relevant log messages
No response
If you have an example file that you can share, please attach it to this issue.
If so, may we include it in our test datasets to help ensure the bug does not return once fixed?
Note: the test datasets are publicly accessible without restriction.
Yes
Code of Conduct
[x] I agree to follow the UCAR/Unidata Code of Conduct
Versions impacted by the bug
5.5.3
What went wrong?
Trying to use any of the projection functions of a GridCoordSystem (like findXYindexFromLatLon) on a file with lambert confomal projection (or potentially other projections too, I have not tested this however) can result in incorrect coordinates being returned, as the projection functions don't respect the units of the dataset. In particular, the issue is the hardcoded earth radius, which is given in km by default. However, this does not get converted when the dataset's false northing/easting values are not given in km. Because of this mismatch of units, the results of the projection functions are always incorrect.
Example datasets where this happens are available from GeoSphere Austria/ZAMG for instance (INCA weather model): ftp://eaftp.zamg.ac.at/nowcast. These files have their false northing/easting given in meters instead of km, which breaks the projection calculations of netcdf-java.
Fix: Check the dataset's units and accordingly convert the earth radius to those units when initializing the GridCoordSystem.
Relevant stack trace
No response
Relevant log messages
No response
If you have an example file that you can share, please attach it to this issue.
If so, may we include it in our test datasets to help ensure the bug does not return once fixed? Note: the test datasets are publicly accessible without restriction.
Yes
Code of Conduct