DirectPosition sourcePos = gridGeometry.gridToWorld(coord);
// TODO: we are performing 2 transforms here, it would probably be more efficient to compose
// the grid-to-crs and crs-to-WGS84 transforms into grid-to-WGS84.
// cf. MathTransformFactory and CoordinateOperationFactory
// convert coordinates in raster CRS to WGS84
DirectPosition targetPos = tr.transform(sourcePos, null);
double lon = targetPos.getOrdinate(0);
double lat = targetPos.getOrdinate(1);
// evaluate using grid coordinates, which should be more efficient than using world coordinates
if (coverage != null)
coverage.evaluate(coord, val);