⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 geotiffmapproducerfactory.java

📁 电子地图服务器,搭建自己的地图服务
💻 JAVA
字号:
/**
 *
 */
package org.vfny.geoserver.wms.responses.map.geotiff;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.vfny.geoserver.global.WMS;
import org.vfny.geoserver.wms.GetMapProducer;
import org.vfny.geoserver.wms.GetMapProducerFactorySpi;


/**
 * {@link GetMapProducerFactorySpi} for producing images in geotiff format.
 *
 * @author Simone Giannecchini, GeoSolutions
 */
public class GeoTiffMapProducerFactory implements GetMapProducerFactorySpi {
    /** the only MIME type this map producer supports */
    static final String MIME_TYPE = "image/tiff";

    /**
     * convenient singleton Set to expose the output format this producer
     * supports
     */
    private static final Set SUPPORTED_FORMATS;

    static {
        SUPPORTED_FORMATS = new HashSet(2);
        SUPPORTED_FORMATS.add("image/geotiff");
        SUPPORTED_FORMATS.add("image/geotiff8");
    }
    /**
    /**
     * Default constructor.
     */
    public GeoTiffMapProducerFactory() {
    }

    public String getName() {
        return "Geographic tagged image format";
    }

    public Set getSupportedFormats() {
        return SUPPORTED_FORMATS;
    }

    public boolean isAvailable() {
        try {
            Class.forName("com.sun.media.imageio.plugins.tiff.GeoTIFFTagSet");

            return true;
        } catch (Exception e) {
        }

        return false;
    }

    public boolean canProduce(String mapFormat) {
        return SUPPORTED_FORMATS.contains(mapFormat);
    }

    public GetMapProducer createMapProducer(String mapFormat, WMS wms)
        throws IllegalArgumentException {
        if (!canProduce(mapFormat)) {
            throw new IllegalArgumentException(mapFormat + " not supported by this map producer");
        }

        return new GeoTiffMapProducer(mapFormat, MIME_TYPE, wms);
    }

    /*
     * (non-Javadoc)
     *
     * @see org.geotools.factory.Factory#getImplementationHints() This just
     *      returns java.util.Collections.EMPTY_MAP
     */
    public Map getImplementationHints() {
        return java.util.Collections.EMPTY_MAP;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -