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.imagepyramid;
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 arc
29: * grid files.
30: *
31: * @author Simone Giannecchini (simboss)
32: * @since 2.3
33: */
34: public final class ImagePyramidFormatFactory implements
35: GridFormatFactorySpi {
36: /**
37: * Tells us if this plugin is avaialble or not. Since usually coverage
38: * plugins depend on JAI and ImageIO classes this method is suitable for
39: * understanding if such a plugin is available or not, preventing users from
40: * having problems later on when trying to instantiate it.
41: *
42: * @return False if this plugin is not availaible true otherwise.
43: */
44: public boolean isAvailable() {
45: boolean available = true;
46:
47: // it needs ImageMosaic and other things inside it
48: try {
49: Class
50: .forName("org.geotools.gce.imagemosaic.ImageMosaicReader");
51: } catch (ClassNotFoundException cnf) {
52: available = false;
53: }
54:
55: return available;
56: }
57:
58: /**
59: * Creates a new {@link ImagePyramidFormat}.
60: * @return an OpenGIS {@link Format} subclass for this coverage.
61: */
62: public Format createFormat() {
63: return new ImagePyramidFormat();
64: }
65:
66: /**
67: * Returns the implementation hints. The default implementation returns en
68: * empty map.
69: *
70: * @return an empty map.
71: */
72: public Map getImplementationHints() {
73: return Collections.EMPTY_MAP;
74: }
75: }
|