/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2001-2008, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ package org.geotools.coverage.processing.operation; // J2SE dependencies import java.lang.reflect.Array; // JAI dependencies import javax.media.jai.Interpolation; // OpenGIS dependencies import org.opengis.coverage.Coverage; import org.opengis.parameter.ParameterDescriptor; import org.opengis.parameter.ParameterValueGroup; // Geotools dependencies import org.geotools.factory.Hints; import org.geotools.coverage.grid.GridCoverage2D; import org.geotools.coverage.grid.Interpolator2D; import org.geotools.coverage.processing.Operation2D; import org.geotools.metadata.iso.citation.Citations; import org.geotools.parameter.DefaultParameterDescriptor; import org.geotools.parameter.DefaultParameterDescriptorGroup; import org.geotools.resources.image.ImageUtilities; /** * Specifies the interpolation type to be used to interpolate values for points which fall between * grid cells. The default value is nearest neighbor. The new interpolation type operates on all * sample dimensions. Possible values for type are: {@code "NearestNeighbor"}, {@code "Bilinear"} * and {@code "Bicubic"} (the {@code "Optimal"} interpolation type is currently not supported). *
* Geotools extension:
* The Geotools implementation provides two extensions to OpenGIS specification: First, it accepts
* also an {@link javax.media.jai.Interpolation} argument type, for interoperability with
* Java Advanced Imaging. Second, it
* accepts also an array of {@link java.lang.String} or {@link javax.media.jai.Interpolation}
* objects. When an array is specified, the first interpolation in the array is applied. If this
* interpolation returns a {@code NaN} value, then the second interpolation is tried as a fallback.
* If the second interpolation returns also a {@code NaN} value, then the third one is tried and so
* on until an interpolation returns a real number or until we reach the end of interpolation list.
* This behavior is convenient when processing remote sensing images of geophysics data, for example
* Sea Surface Temperature (SST), in which clouds may mask many pixels (i.e. set them
* to some {@code NaN} values). Because {@code "Bicubic"} interpolation needs 4×4 pixels while
* {@code "Bilinear"} interpolation needs only 2x2 pixels, the {@code "Bilinear"} interpolation is
* less likely to fails because of clouds ({@code NaN} values) than the {@code "Bicubic"} one
* (note: only one {@code NaN} value is enough to make an interpolation fails). One can workaround
* the problem by trying a bicubic interpolation first, then a linear interpolation if
* {@code "Bicubic"} failed at a particular location, etc. This behavior can be
* specified with the following {@code "Type"} argument:
* new String[]{"Bicubic", "Bilinear", "NearestNeighbor"}
.
*
*
Name: "Interpolate"
* JAI operator: N/A
* Parameters:
Name | *Class | *Default value | *Minimum value | *Maximum value | *
---|---|---|---|---|
{@code "Source"} | *{@link org.geotools.coverage.grid.GridCoverage2D} | *N/A | *N/A | *N/A | *
{@code "Type"} | *{@link java.lang.CharSequence} | *"NearestNeighbor" | *N/A | *N/A | *