-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Versions impacted by the bug
We are using the latest release of thredds-docker (version 5.5), based on this commit, I assume it is version 5.6.0 or 5.6.1-SNAPSHOT. I was not able to identify the version in the container.
What went wrong?
Using thredds-docker, when subsetting a netcdf that has non-zero false_easting and false_norting and units m (https://epsg.io/3416), e.g. NetcdfSubset in catalog, the units for false_easting and false_northing get converted to km. But the projection_{x|y}_coordinates (and specifications in the esri_pe_string for the data variables) are still in m.
Definition of projection and projection coordinates in the original file:
char lambert_conformal_conic;
:semi_major_axis = 6378137.0; // double
:latitude_of_projection_origin = 47.5; // double
:inverse_flattening = 298.257222101; // double
:longitude_of_central_meridian = 13.3333333333333; // double
:standard_parallel = 49.0, 46.0; // double
:false_northing = 400000.0; // double
:grid_mapping_name = "lambert_conformal_conic";
:semi_minor_axis = 6356752.31414036; // double
:false_easting = 400000.0; // double
double x(x=585);
:units = "m";
:long_name = "x coordinate of projection";
:standard_name = "projection_x_coordinate";
:axis = "X";
double y(y=314);
:long_name = "y coordinate of projection";
:standard_name = "projection_y_coordinate";
:axis = "Y";
:units = "m";
Values after subsetting (with projection coordinates added again for completeness):
int lambert_conformal_conic;
:grid_mapping_name = "lambert_conformal_conic";
:latitude_of_projection_origin = 47.5; // double
:longitude_of_central_meridian = 13.3333333333333; // double
:standard_parallel = 49.0, 46.0; // double
:false_easting = 400.0; // double
:false_northing = 400.0; // double
:units = "km";
:semi_major_axis = 6378137.0; // double
:inverse_flattening = 298.257222101; // double
double x(x=585);
:units = "m";
:long_name = "x coordinate of projection";
:standard_name = "projection_x_coordinate";
:axis = "X";
double y(y=314);
:long_name = "y coordinate of projection";
:standard_name = "projection_y_coordinate";
:axis = "Y";
:units = "m";
According to CF, as also stated here
netcdf-java/cdm/core/src/main/java/ucar/nc2/dataset/transform/AbstractTransformBuilder.java
Lines 33 to 37 in a7c05d8
| * from CF: false_easting(false_northing): | |
| * The value added to all abscissa(ordinate) values in the rectangular coordinates for a map projection. | |
| * This value frequently is assigned to eliminate negative numbers. | |
| * Expressed in the unit of the coordinate variable identified by the standard name projection_x_coordinate | |
| * (projection_y_coordinate). |
Could it be related to this line?
netcdf-java/cdm/core/src/main/java/ucar/nc2/dataset/transform/AbstractTransformBuilder.java
Line 80 in a7c05d8
| return unit.convertTo(1.0, SimpleUnit.kmUnit); |
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
- I agree to follow the UCAR/Unidata Code of Conduct

