1

I have a GridCoverage2D in EPSG:4054. I want to transform it to EPSG:4326.

I have tried to do it this way:

/** gc2d is an GridCoverage2D in EPSG:4054 */
CoordinateReferenceSystem targetCRS = crsAuthorityFactory.createCoordinateReferenceSystem("EPSG:4326");
GridCoverage2D gc2d_projected_2 = Resample(gc2d, targetCRS);

where Resample function is:

public static GridCoverage2D Resample(GridCoverage2D input, CoordinateReferenceSystem targetCRS) throws FactoryException {
    final CoverageProcessor processor = CoverageProcessor.getInstance(null);
    final ParameterValueGroup param=processor.getOperation("Resample").getParameters();
    param.parameter("Source").setValue(input);
    param.parameter("CoordinateReferenceSystem").setValue(targetCRS);
    param.parameter("InterpolationType").setValue("bilinear");
    return (GridCoverage2D) processor.doOperation(param);
}

Here I get "Bursa wolf parameters required" error. I think that's because EPSG:4054 and EPSG:4326 are based on the different ellipsoids (Hughes 1980 and WGS84). What is the proper way to do this?

kiyah
  • 1,502
  • 2
  • 18
  • 27
  • I have found some work-around to solve my problem. However I'm not sure that is is the best solution. I have manually created WKT definition of the CRS of my source coverage. And added there some TOWGS84[dx,dy,dz,rx,ry,rz,s] string with custom bursa wolf coefficients. Unfortunately I can't find exact values as described here http://jgrasstechtips.blogspot.ru/2008/03/how-to-find-and-use-bursa-wolf.html and use TOWGS84[0,0,0,0,0,0,0] which leads to slightly wrong transformation. – Timur Kobilov Feb 01 '18 at 12:52
  • Another way was to just define EPSG:4326 to my EPSG:4054 coverage without any transformation. Image displacements were even less then for using TOWGS84[0,0,0,0,0,0,0] – Timur Kobilov Feb 01 '18 at 12:55

0 Answers0