diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/META-INF/MANIFEST.MF index fc5d44c26d..a884fe93b2 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/META-INF/MANIFEST.MF @@ -31,7 +31,8 @@ Require-Bundle: org.springframework;bundle-version="2.5.6", com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0", com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0", com.raytheon.uf.common.parameter;bundle-version="1.0.0", - com.raytheon.uf.edex.plugin.grid;bundle-version="1.0.0" + com.raytheon.uf.edex.plugin.grid;bundle-version="1.0.0", + com.raytheon.uf.common.style;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Export-Package: com.raytheon.uf.edex.plugin.grib.ogc diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/src/com/raytheon/uf/edex/plugin/grib/ogc/GribWmsSource.java b/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/src/com/raytheon/uf/edex/plugin/grib/ogc/GribWmsSource.java deleted file mode 100644 index 2ac8dbedfd..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/src/com/raytheon/uf/edex/plugin/grib/ogc/GribWmsSource.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.plugin.grib.ogc; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import com.raytheon.uf.common.dataplugin.PluginException; -import com.raytheon.uf.common.dataplugin.PluginProperties; -import com.raytheon.uf.common.dataplugin.grid.GridRecord; -import com.raytheon.uf.edex.ogc.common.OgcException; -import com.raytheon.uf.edex.ogc.common.db.LayerTransformer; -import com.raytheon.uf.edex.wms.WmsException; -import com.raytheon.uf.edex.wms.WmsException.Code; -import com.raytheon.uf.edex.wms.reg.DefaultWmsSource; -import com.raytheon.uf.edex.wms.styling.ColormapStyleProvider; -import com.raytheon.uf.edex.wms.styling.ICoverageStyleProvider; - -/** - * - * @author jelkins - * @version 1.0 - */ -public class GribWmsSource extends - DefaultWmsSource { - - protected ColormapStyleProvider styler = new GridStyleProvider( - this, "Grid/Default"); - - public GribWmsSource(PluginProperties props, - LayerTransformer transformer) - throws PluginException { - super(props, props.getPluginName(), transformer); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.wms.reg.DefaultWmsSource#getRecord(java.lang.String, - * java.lang.String, java.lang.String, java.util.Map) - */ - @Override - protected GridRecord getRecord(String layer, String time, String elevation, - Map dimensions) throws WmsException { - LayerTransformer transformer; - List res; - try { - transformer = getTransformer(); - res = GribRecordFinder.findWms(transformer, key, layer, time, - dimensions); - } catch (OgcException e) { - WmsException err = new WmsException(e); - if (err.getCode().equals(Code.InternalServerError)) { - log.error("Problem getting grib layer: " + layer); - } - throw err; - } catch (PluginException e) { - log.error("Unable to get transformer for grib", e); - throw new WmsException(Code.InternalServerError); - } - if (res.isEmpty()) { - throw new WmsException(Code.LayerNotDefined, - "No layer matching all specified dimensions found"); - } - if (res.size() > 1) { - Collections.sort(res, new GribRecordFinder.Comp()); - } - return res.get(0); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.wms.reg.DefaultWmsSource#getStyleProvider(java.lang - * .String) - */ - @Override - protected ICoverageStyleProvider getStyleProvider(String layer) - throws WmsException { - return styler; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/src/com/raytheon/uf/edex/plugin/grib/ogc/GridStyleProvider.java b/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/src/com/raytheon/uf/edex/plugin/grib/ogc/GridStyleProvider.java deleted file mode 100644 index bd1e69016d..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.plugin.grib.ogc/src/com/raytheon/uf/edex/plugin/grib/ogc/GridStyleProvider.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Copyright 09/24/12 Raytheon Company. - * - * Unlimited Rights - * This software was developed pursuant to Contract Number - * DTFAWA-10-D-00028 with the US Government. The US Government’s rights - * in and to this copyrighted software are as specified in DFARS - * 252.227-7014 which was made part of the above contract. - */ -package com.raytheon.uf.edex.plugin.grib.ogc; - -import javax.measure.unit.Unit; - -import com.raytheon.uf.common.dataplugin.PluginException; -import com.raytheon.uf.common.dataplugin.grid.GridRecord; -import com.raytheon.uf.common.dataplugin.grid.util.GridStyleUtil; -import com.raytheon.uf.common.datastorage.records.FloatDataRecord; -import com.raytheon.uf.common.datastorage.records.IDataRecord; -import com.raytheon.uf.common.parameter.Parameter; -import com.raytheon.uf.common.style.ParamLevelMatchCriteria; -import com.raytheon.uf.edex.ogc.common.IStyleLookupCallback; -import com.raytheon.uf.edex.plugin.grid.dao.GridDao; -import com.raytheon.uf.edex.wms.WmsException; -import com.raytheon.uf.edex.wms.WmsException.Code; -import com.raytheon.uf.edex.wms.styling.ColormapStyleProvider; - -/** - * Style provider specific to grid colormapped imagery - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jul 2, 2013            bclement     Initial creation
- * 
- * 
- * - * @author bclement - * @version 1.0 - */ -public class GridStyleProvider extends ColormapStyleProvider { - - - - /** - * @param styleLibraryFileName - * @param defaultColormap - */ - public GridStyleProvider(IStyleLookupCallback callback, - String defaultColormap) { - super(callback, defaultColormap); - } - - /** - * @param styleLibraryFileName - */ - public GridStyleProvider(IStyleLookupCallback callback) { - super(callback); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.wms.styling.ColormapStyleProvider#getCriteria(com - * .raytheon.uf.common.dataplugin.PluginDataObject) - */ - @Override - protected ParamLevelMatchCriteria getCriteria(GridRecord record) - throws WmsException { - return GridStyleUtil - .getMatchCriteria((GridRecord) record); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.wms.styling.ColormapStyleProvider#getParamUnits( - * com.raytheon.uf.common.dataplugin.PluginDataObject) - */ - @Override - protected Unit getParamUnits(GridRecord record) throws WmsException { - Parameter parameter = record.getInfo().getParameter(); - return parameter.getUnit(); - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.edex.wms.styling.ColormapStyleProvider#getRawData(com - * .raytheon.uf.common.dataplugin.PluginDataObject) - */ - @Override - protected Object getRawData(GridRecord record) throws WmsException { - Object data; - try { - GridDao dao = new GridDao(); - IDataRecord[] res = dao.getHDF5Data(record, 0); - FloatDataRecord datarecord = (FloatDataRecord) res[0]; - data = datarecord.getFloatData(); - } catch (PluginException e) { - log.error("Unable to retrieve grib data", e); - throw new WmsException(Code.InternalServerError); - } - return data; - } - -}