[Geoserver-devel] Raster interpolation issue

Hello,

I am working on a really “simple” task, but I do not make any progress with it.

In have got a GridCoverage2D which I want to interpolate. I am using some sample code from the GeoTools documentation:

javax.media.jai.Interpolation interp = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);

GridCoverage2D covinterpol = (GridCoverage2D) Operations.DEFAULT.interpolate(scicov, interp);

RenderedImage ri = covinterpol.getRenderedImage();

My problem is that the resulting RenderedImage is equal to the input image of the GridCoverage2D scicov. Nothing changes. What am I doing wrong?

My own try is not working, too:

Final Interpolation interpolation = new Interpolation {

Interpolation.getInstance(Interpolation.INTERP_BICUBIC),

Interpolation.getInstance(Interpolation.INTERP_BICUBIC_2),

Interpolation.getInstance(Interpolation.INTERP_BILINEAR),

Interpolation.getInstance(Interpolation.INTERP_NEAREST) };

Final ParameterValueGroup param = interpolateParams.clone();

param.parameter(“Source”).setValue(coverage);

param.parameter(“Type”).setValue(interpolations);

coverage = (GridCoverage2D) interpolateFactory.doOperation(param, hints);

I am grateful for every hint! :wink:

With best regards

Tobias

Tobias Neumann, M.Sc.

Softwareingenieur Geoinformatik

Tel: +49 89 608090-276
Fax: +49 89 6098182
E-Mail: Tobias.Neumann@anonymised.com
Web: www.berner-mattner.com

Berner & Mattner Systemtechnik GmbH
Erwin-von-Kreibig-Str. 3
D-80807 München

Geschäftsführer: Dr. Klaus Eder, Dr. Jan-Oliver Wenzel
Registernummer: HR B 83252 beim Amtsgericht München
Sitz der Gesellschaft: München