/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2014, 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.process.spatialstatistics; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.TreeMap; import java.util.logging.Logger; import org.geotools.coverage.grid.GridCoverage2D; import org.geotools.data.Parameter; import org.geotools.feature.NameImpl; import org.geotools.geometry.jts.ReferencedEnvelope; import org.geotools.process.Process; import org.geotools.util.logging.Logging; import org.opengis.util.InternationalString; /** * RasterClipByExtentProcessFactory * * @author Minpa Lee, MangoSystem * * @source $URL$ */ public class RasterClipByExtentProcessFactory extends SpatialStatisticsProcessFactory { protected static final Logger LOGGER = Logging .getLogger(RasterClipByExtentProcessFactory.class); private static final String PROCESS_NAME = "RasterClipByExtent"; /* * RasterClipByExtent(GridCoverage2D inputCoverage, ReferencedEnvelope extent): GridCoverage2D */ public RasterClipByExtentProcessFactory() { super(new NameImpl(NAMESPACE, PROCESS_NAME)); } @Override public Process create() { return new RasterClipByExtentProcess(this); } @Override public InternationalString getTitle() { return getResource("RasterClipByExtent.title"); } @Override public InternationalString getDescription() { return getResource("RasterClipByExtent.description"); } /** inputCoverage */ public static final Parameter<GridCoverage2D> inputCoverage = new Parameter<GridCoverage2D>( "inputCoverage", GridCoverage2D.class, getResource("RasterClipByExtent.inputCoverage.title"), getResource("RasterClipByExtent.inputCoverage.description"), true, 1, 1, null, null); /** extent */ public static final Parameter<ReferencedEnvelope> extent = new Parameter<ReferencedEnvelope>( "cropShape", ReferencedEnvelope.class, getResource("RasterClipByExtent.extent.title"), getResource("RasterClipByExtent.extent.description"), true, 1, 1, null, null); @Override protected Map<String, Parameter<?>> getParameterInfo() { HashMap<String, Parameter<?>> parameterInfo = new LinkedHashMap<String, Parameter<?>>(); parameterInfo.put(inputCoverage.key, inputCoverage); parameterInfo.put(extent.key, extent); return parameterInfo; } /** result */ public static final Parameter<GridCoverage2D> RESULT = new Parameter<GridCoverage2D>("result", GridCoverage2D.class, getResource("RasterClipByExtent.result.title"), getResource("RasterClipByExtent.result.description")); static final Map<String, Parameter<?>> resultInfo = new TreeMap<String, Parameter<?>>(); static { resultInfo.put(RESULT.key, RESULT); } @Override protected Map<String, Parameter<?>> getResultInfo(Map<String, Object> parameters) throws IllegalArgumentException { return Collections.unmodifiableMap(resultInfo); } }