01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2005-2006, Geotools Project Managment Committee (PMC)
05: * (C) 2005, Institut de Recherche pour le Développement
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package org.geotools.coverage.processing.operation;
18:
19: // OpenGIS dependencies
20: import org.opengis.coverage.grid.GridCoverage;
21:
22: // Geotools dependencies
23: import org.geotools.coverage.processing.FilterOperation;
24:
25: /**
26: * Replaces {@link Float#NaN NaN} values by the weighted average of neighbors values. This
27: * operation uses a box of {@code size}×{@code size} pixels centered on each {@code NaN}
28: * value, where {@code size} = 2×{@code padding}+1 (the <cite>padding</cite> is the number
29: * of pixel above, below, to the left and to the right of central {@code NaN} pixel). The weighted
30: * average is then computed, ignoring all {@code NaN} values. If the number of valid values is
31: * greater than or equals to {@code validityThreshold}, then the center {@code NaN} is replaced by
32: * the computed average. Otherwise, the {@code NaN} value is left unchanged.
33: *
34: * <P><STRONG>Name:</STRONG> <CODE>"NodataFilter"</CODE><BR>
35: * <STRONG>JAI operator:</STRONG> none<BR>
36: * <STRONG>Parameters:</STRONG></P>
37: * <table border='3' cellpadding='6' bgcolor='F4F8FF'>
38: * <tr bgcolor='#B9DCFF'>
39: * <th>Name</th>
40: * <th>Class</th>
41: * <th>Default value</th>
42: * <th>Minimum value</th>
43: * <th>Maximum value</th>
44: * </tr>
45: * <tr>
46: * <td>{@code "Source"}</td>
47: * <td>{@link org.geotools.coverage.grid.GridCoverage2D}</td>
48: * <td align="center">N/A</td>
49: * <td align="center">N/A</td>
50: * <td align="center">N/A</td>
51: * </tr>
52: * <tr>
53: * <td>{@code "padding"}</td>
54: * <td>{@link java.lang.Integer}</td>
55: * <td>1</td>
56: * <td align="center">0</td>
57: * <td align="center">N/A</td>
58: * </tr>
59: * <tr>
60: * <td>{@code "validityThreshold"}</td>
61: * <td>{@link java.lang.Integer}</td>
62: * <td>4</td>
63: * <td align="center">0</td>
64: * <td align="center">N/A</td>
65: * </tr>
66: * </table>
67: *
68: * @since 2.2
69: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/coverage/src/main/java/org/geotools/coverage/processing/operation/NodataFilter.java $
70: * @version $Id: NodataFilter.java 20970 2006-08-11 07:53:22Z jgarnett $
71: * @author Martin Desruisseaux
72: *
73: * @see org.geotools.coverage.processing.Operations#nodataFilter(GridCoverage,int,int)
74: */
75: public class NodataFilter extends FilterOperation {
76: /**
77: * Serial number for interoperability with different versions.
78: */
79: private static final long serialVersionUID = 6818008657792977519L;
80:
81: /**
82: * Constructs a default {@code "NodataFilter"} operation.
83: */
84: public NodataFilter() {
85: super ("org.geotools.NodataFilter");
86: }
87: }
|