我在EPSG中有一个GridCoverage2D:4054。我想将它转换为EPSG:4326。
我试过这样做:
/** gc2d is an GridCoverage2D in EPSG:4054 */
CoordinateReferenceSystem targetCRS = crsAuthorityFactory.createCoordinateReferenceSystem("EPSG:4326");
GridCoverage2D gc2d_projected_2 = Resample(gc2d, targetCRS);
其中Resample函数是:
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);
}
在这里,我得到了#34;所需的布尔萨狼参数"错误。我认为这是因为EPSG:4054和EPSG:4326是基于不同的椭圆体(Hughes 1980和WGS84)。 这样做的正确方法是什么?