Merge "Issue #2516 Remove classes causing WCS to not compile." into development

Former-commit-id: 52c5a3a966 [formerly 52c5a3a966 [formerly 9f8341790c94cc59b79a1226e23635298092670f]]
Former-commit-id: b6afeae19b
Former-commit-id: b1d6d16182
This commit is contained in:
Nate Jensen 2013-11-06 08:56:17 -06:00 committed by Gerrit Code Review
commit 57c1f7b87c
3 changed files with 2 additions and 216 deletions

View file

@ -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.gridcoverage;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.grid;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.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-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.edex.plugin.grib.ogc Export-Package: com.raytheon.uf.edex.plugin.grib.ogc

View file

@ -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<GribDimension, GridParamLayer, GridRecord> {
protected ColormapStyleProvider<GridRecord> styler = new GridStyleProvider(
this, "Grid/Default");
public GribWmsSource(PluginProperties props,
LayerTransformer<GribDimension, GridParamLayer> 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<String, String> dimensions) throws WmsException {
LayerTransformer<GribDimension, GridParamLayer> transformer;
List<GridRecord> 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<GridRecord> getStyleProvider(String layer)
throws WmsException {
return styler;
}
}

View file

@ -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 Governments 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
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 2, 2013 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class GridStyleProvider extends ColormapStyleProvider<GridRecord> {
/**
* @param styleLibraryFileName
* @param defaultColormap
*/
public GridStyleProvider(IStyleLookupCallback<GridRecord> callback,
String defaultColormap) {
super(callback, defaultColormap);
}
/**
* @param styleLibraryFileName
*/
public GridStyleProvider(IStyleLookupCallback<GridRecord> 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;
}
}