01: /*
02: * Geotools 2 - OpenSource mapping toolkit
03: * (C) 2006, Geotools Project Managment Committee (PMC)
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19: package org.geotools.gce.imagemosaic;
20:
21: import java.util.Collections;
22: import java.util.Map;
23:
24: import org.geotools.coverage.grid.io.GridFormatFactorySpi;
25: import org.opengis.coverage.grid.Format;
26:
27: /**
28: * Implementation of the GridCoverageFormat service provider interface for
29: * mosaic of georeferenced images.
30: *
31: * @author Simone Giannecchini (simboss)
32: * @since 2.3
33: */
34: public final class ImageMosaicFormatFactory implements
35: GridFormatFactorySpi {
36: /**
37: * Tells me if this plugin will work on not given the actual installation.
38: *
39: * <p>
40: * Dependecies are mostly from JAI and ImageIO so if they are installed you
41: * should not have many problems.
42: *
43: * @return False if something's missing, true otherwise.
44: */
45: public boolean isAvailable() {
46: boolean available = true;
47:
48: // if these classes are here, then the runtine environment has
49: // access to JAI and the JAI ImageI/O toolbox.
50: try {
51: Class.forName("javax.media.jai.JAI");
52: Class
53: .forName("com.sun.media.jai.operator.ImageReadDescriptor");
54: } catch (ClassNotFoundException cnf) {
55: available = false;
56: }
57:
58: return available;
59: }
60:
61: /**
62: * @see GridFormatFactorySpi#createFormat().
63: */
64: public Format createFormat() {
65: return new ImageMosaicFormat();
66: }
67:
68: /**
69: * Returns the implementation hints. The default implementation returns en
70: * empty map.
71: *
72: * @return An empty map.
73: */
74: public Map getImplementationHints() {
75: return Collections.EMPTY_MAP;
76: }
77: }
|