/** * Add GeoReferencing information to the writer, * starting from the CoordinateReferenceSystem and the MathTransform * * @param writer * @param crs * @param transform */ public void updateProjectionInformation(NetCDFCoordinateReferenceSystemType crsType, NetcdfFileWriter writer, CoordinateReferenceSystem crs, MathTransform transform) { NetCDFProjection projection = crsType.getNetCDFProjection(); // Projection may be exposed as standard NetCDF CF GridMapping (if available) // as well as through SPATIAL_REF and GeoTransform attributes (GDAL way) if (projection != null) { String name = projection.getName(); Variable var = writer.findVariable(name); setGridMappingVariableAttributes(writer, crs, var, projection); setGeoreferencingAttributes(writer, crs, transform, var); } else { addGlobalAttributes(writer, crs, transform); } }
/** * Add GeoReferencing information to the writer, starting from the CoordinateReferenceSystem and * the MathTransform * * @param writer * @param crs * @param transform */ public void updateProjectionInformation( NetCDFCoordinateReferenceSystemType crsType, NetcdfFileWriter writer, CoordinateReferenceSystem crs, MathTransform transform) { NetCDFProjection projection = crsType.getNetCDFProjection(); // Projection may be exposed as standard NetCDF CF GridMapping (if available) // as well as through SPATIAL_REF and GeoTransform attributes (GDAL way) if (projection != null) { String name = projection.getName(); Variable var = writer.findVariable(name); setGridMappingVariableAttributes(writer, crs, var, projection); setGeoreferencingAttributes(writer, crs, transform, var); } else { addGlobalAttributes(writer, crs, transform); } }