Issue #2472 Replacing lost commit

Former-commit-id: 7c1f7ad737361b55e85bdf48dad24c7a60b36e99
This commit is contained in:
Dave Hladky 2013-11-04 16:24:14 -06:00
parent 3e7b7cec8f
commit 9c6a430d40
180 changed files with 4782 additions and 4296 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cxf
Bundle-SymbolicName: org.apache.commons.cxf
Bundle-Version: 1.0.0.qualifier
Bundle-Version: 2.5.10.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: FastInfoset-1.2.9.jar,
geronimo-activation_1.1_spec-1.1.jar,

View file

@ -21,12 +21,6 @@
<import feature="com.raytheon.uf.edex.registry.client.feature" version="0.0.0"/>
</requires>
<plugin
id="ll.netcdf"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="net.opengis"
download-size="0"
@ -86,13 +80,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="com.raytheon.uf.common.nc4"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.plugin.unitconverter"
download-size="0"
@ -114,13 +101,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.plugin.grib.ogc"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.plugin.obs.ogc"
download-size="0"
@ -142,13 +122,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.wms"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.plugin.datadelivery.retrieval"
download-size="0"
@ -184,11 +157,4 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.wcs"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -15,4 +15,7 @@ Import-Package: com.raytheon.edex.msg,
com.raytheon.uf.edex.database.purge
Require-Bundle: org.apache.commons.collections,
ch.qos.logback;bundle-version="1.0.13",
org.slf4j;bundle-version="1.7.5"
org.slf4j;bundle-version="1.7.5",
org.apache.commons.cxf;bundle-version="2.5.10"
Export-Package: com.raytheon.uf.edex.log,
com.raytheon.uf.edex.log.cxf

View file

@ -0,0 +1,136 @@
/**
* 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.log.cxf;
import java.io.InputStream;
import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.interceptor.LoggingMessage;
import org.apache.cxf.io.CachedOutputStream;
import org.apache.cxf.io.DelegatingInputStream;
import org.apache.cxf.message.Message;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
public class CXFLogger extends org.apache.cxf.interceptor.LoggingInInterceptor {
protected IUFStatusHandler log = UFStatus.getHandler(this.getClass());
@Override
public void handleMessage(Message message) throws Fault {
if (writer != null ||
RequestLogController.getInstance().shouldLogRequestsInfo() &&
log.isPriorityEnabled(RequestLogController.getInstance().getRequestLogLevel())) {
logging(message);
}
}
/**
* implement custom content for incoming requests in our own log format
* @param message
* @throws Fault
*/
protected void logging(Message message) throws Fault {
if (message.containsKey(LoggingMessage.ID_KEY)) {
return;
}
String id = (String)message.getExchange().get(LoggingMessage.ID_KEY);
if (id == null) {
id = LoggingMessage.nextId();
message.getExchange().put(LoggingMessage.ID_KEY, id);
}
message.put(LoggingMessage.ID_KEY, id);
final LoggingMessage buffer
= new LoggingMessage("Inbound Message\n--------------------------", id);
Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE);
if (responseCode != null) {
buffer.getResponseCode().append(responseCode);
}
String encoding = (String)message.get(Message.ENCODING);
if (encoding != null) {
buffer.getEncoding().append(encoding);
}
String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD);
if (httpMethod != null) {
buffer.getHttpMethod().append(httpMethod);
}
String ct = (String)message.get(Message.CONTENT_TYPE);
if (ct != null) {
buffer.getContentType().append(ct);
}
Object headers = message.get(Message.PROTOCOL_HEADERS);
if (headers != null) {
buffer.getHeader().append(headers);
}
String uri = (String)message.get(Message.REQUEST_URL);
if (uri != null) {
buffer.getAddress().append(uri);
String query = (String)message.get(Message.QUERY_STRING);
if (query != null) {
buffer.getAddress().append("?").append(query);
}
}
if (!isShowBinaryContent() && isBinaryContent(ct)) {
buffer.getMessage().append(BINARY_CONTENT_MESSAGE).append('\n');
log.handle(RequestLogController.getInstance().getRequestLogLevel(),
buffer.toString());
return;
}
InputStream is = message.getContent(InputStream.class);
if (is != null) {
CachedOutputStream bos = new CachedOutputStream();
if (threshold > 0) {
bos.setThreshold(threshold);
}
try {
// use the appropriate input stream and restore it later
InputStream bis = is instanceof DelegatingInputStream
? ((DelegatingInputStream)is).getInputStream() : is;
IOUtils.copyAndCloseInput(bis, bos);
bos.flush();
bis = bos.getInputStream();
// restore the delegating input stream or the input stream
if (is instanceof DelegatingInputStream) {
((DelegatingInputStream)is).setInputStream(bis);
} else {
message.setContent(InputStream.class, bis);
}
if (bos.getTempFile() != null) {
//large thing on disk...
buffer.getMessage().append("\nMessage (saved to tmp file):\n");
buffer.getMessage().append("Filename: " + bos.getTempFile().getAbsolutePath() + "\n");
}
if (bos.size() > limit) {
buffer.getMessage().append("(message truncated to " + limit + " bytes)\n");
}
writePayload(buffer.getPayload(), bos, encoding, ct);
bos.close();
} catch (Exception e) {
throw new Fault(e);
}
}
log.handle(RequestLogController.getInstance().getRequestLogLevel(),
buffer.toString());
}
}

View file

@ -0,0 +1,63 @@
/**
* 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.log.cxf;
import com.raytheon.uf.common.status.UFStatus.Priority;
/**
* Singleton to control how incoming request information is logged. Implemented as
* a singleton to allow runtime control from a Web Client
* @author behemmi
*
*/
public class RequestLogController {
private static RequestLogController instance = null;
private Priority requestLogLevel;
private boolean shouldLogRequestsInfo;
private RequestLogController(){
requestLogLevel = Priority.DEBUG;
shouldLogRequestsInfo = true;
}
public static RequestLogController getInstance() {
if(instance == null) {
instance = new RequestLogController();
}
return instance;
}
public Priority getRequestLogLevel() {
return requestLogLevel;
}
public void setRequestLogLevel(Priority requestLogLevel) {
this.requestLogLevel = requestLogLevel;
}
public boolean shouldLogRequestsInfo() {
return getShouldLogRequestsInfo();
}
/**
* Traditional getter for Jackson serialization.
*
* @return shouldLogRequestsInfo - if this logger is enabled
*/
public boolean getShouldLogRequestsInfo() {
return shouldLogRequestsInfo;
}
public void setShouldLogRequestsInfo(boolean shouldLogRequestsInfo) {
this.shouldLogRequestsInfo = shouldLogRequestsInfo;
}
}

View file

@ -22,7 +22,8 @@ Require-Bundle: net.opengis;bundle-version="1.0.2",
ogc.tools.gml;bundle-version="1.0.2",
org.apache.commons.cxf,
org.eclipse.jetty;bundle-version="7.6.9",
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174"
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
com.raytheon.uf.edex.log;bundle-version="1.12.1174"
Export-Package: com.raytheon.uf.edex.ogc.common,
com.raytheon.uf.edex.ogc.common.colormap,
com.raytheon.uf.edex.ogc.common.db,

View file

@ -52,10 +52,10 @@ public class AbstractFsStore {
protected static File findStore(String directoryName) {
IPathManager pathMgr = PathManagerFactory.getPathManager();
LocalizationContext edexStaticCONFIGURED = pathMgr.getContext(
LocalizationContext context = pathMgr.getContext(
LocalizationContext.LocalizationType.EDEX_STATIC,
LocalizationContext.LocalizationLevel.CONFIGURED);
return pathMgr.getFile(edexStaticCONFIGURED, directoryName);
LocalizationContext.LocalizationLevel.BASE);
return pathMgr.getFile(context, directoryName);
}
/**

View file

@ -0,0 +1,38 @@
/**
* 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.ogc.common;
import java.util.List;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 30, 2013 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public interface IStyleLookupCallback<R extends PluginDataObject> {
public R lookupSample(String layerName) throws OgcException;
public List<R> getAllSamples() throws OgcException;
}

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.ogc.common;
import com.vividsolutions.jts.geom.Envelope;

View file

@ -1,27 +1,22 @@
/**********************************************************************
*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
**********************************************************************/
/**
* 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.
**/
/**
*
*/

View file

@ -1,26 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* 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.ogc.common;

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.
**/
/**
*
*/

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.ogc.common;
import java.io.UnsupportedEncodingException;

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.
**/
/**
*
*/
@ -102,4 +97,6 @@ public class OgcNamespace {
public static final String OWSNT = "http://www.opengis.net/owsnt/1.1";
public static final String NAWX15 = "http://www.faa.gov/nawx/1.5";
}

View file

@ -1,27 +1,22 @@
/**********************************************************************
*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
**********************************************************************/
/**
* 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.
**/
/**
*
*/
@ -44,6 +39,8 @@ public class OgcOperationInfo<T> {
protected String postEncoding;
protected String httpBaseHostname;
protected List<String> formats = new LinkedList<String>();
protected List<String> versions = new LinkedList<String>();
@ -63,10 +60,12 @@ public class OgcOperationInfo<T> {
this.type = type;
}
public OgcOperationInfo(T type, String httpPostRes, String httpGetRes) {
public OgcOperationInfo(T type, String httpPostRes, String httpGetRes,
String httpBaseHostname) {
this(type);
this.httpGetRes = httpGetRes;
this.httpPostRes = httpPostRes;
this.httpBaseHostname = httpBaseHostname;
}
public void addFormat(String format) {
@ -223,4 +222,12 @@ public class OgcOperationInfo<T> {
this.postEncoding = postEncoding;
}
public String getHttpBaseHostname() {
return httpBaseHostname;
}
public void setHttpBaseHostname(String httpBaseHostname) {
this.httpBaseHostname = httpBaseHostname;
}
}

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.
**/
/**
*
*/
@ -122,4 +117,6 @@ public class OgcPrefix {
public static final String OWSNT = "owsnt";
public static final String NAWX = "nawx";
}

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.ogc.common;
import com.raytheon.uf.edex.ogc.common.http.MimeType;

View file

@ -1,27 +1,22 @@
/**********************************************************************
*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
**********************************************************************/
/**
* 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.
**/
/**
*
*/

View file

@ -1,27 +1,22 @@
/**********************************************************************
*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
**********************************************************************/
/**
* 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.ogc.common;
public class OgcStyle {

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 bclement Initial creation
*
*/
/**
* 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.ogc.common;
import java.util.List;

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.ogc.common;
import java.io.Serializable;

View file

@ -1,26 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* 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.ogc.common.db;
import java.util.ArrayList;

View file

@ -128,7 +128,9 @@ public class FsLayerStore extends AbstractFsStore implements ILayerStore {
*/
private File getClassDirRead(Class<?> c) throws OgcException {
File rval = new File(storeLocation, c.getName());
if (!rval.exists()) {
return rval;
}
if (!rval.isDirectory()) {
throw new OgcException(Code.InternalServerError,
rval.getAbsolutePath() + " is not a directory");

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 11, 2012 bclement Initial creation
*
*/
/**
* 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.ogc.common.db;
import java.util.List;

View file

@ -1,26 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* 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.ogc.common.db;
import java.lang.reflect.Constructor;

View file

@ -1,26 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* 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.ogc.common.db;
import java.util.ArrayList;

View file

@ -1,34 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 06, 2012 bclement Initial creation
* Oct 14, 2013 2361 njensen Changed @Entity to @MappedSuperclass
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.db;
import java.util.Date;
@ -48,10 +36,17 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.edex.ogc.common.db.LayerTransformer.TimeFormat;
/**
*
* @author bclement
* @version 1.0
*/
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2011 bclement Initial creation
* 10/22/2013 2742 dhladky @Entity made for Db dependency in AWIPS code, changed to @MappedSuperclass
*
*
* @author bclement
* @version 1.0
*/
@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@XmlAccessorType(XmlAccessType.NONE)
@ -62,21 +57,21 @@ public abstract class PointDataLayer extends
private static final long serialVersionUID = 4301480632118555546L;
public PointDataLayer() {
}
}
public PointDataLayer(SimpleLayer<DefaultPointDataDimension> other) {
super(other);
}
super(other);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.edex.ogc.common.db.SimpleLayer#getTimeEntries()
*/
@Override
public List<String> getTimeEntries() {
return LayerTransformer.getTimes(this, TimeFormat.HOUR_RANGES);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.edex.ogc.common.db.SimpleLayer#getTimeEntries()
*/
@Override
public List<String> getTimeEntries() {
return LayerTransformer.getTimes(this, TimeFormat.HOUR_RANGES);
}
/*
* (non-Javadoc)
@ -93,10 +88,10 @@ public abstract class PointDataLayer extends
*
* @see com.raytheon.uf.edex.ogc.common.db.SimpleLayer#getDefaultTimeEntry()
*/
@Override
public String getDefaultTimeEntry() {
return LayerTransformer.getTimeRange(getDefaultTime());
}
@Override
public String getDefaultTimeEntry() {
return LayerTransformer.getTimeRange(getDefaultTime());
}
/**
* Create formatted time range string with range start at the latest time
@ -105,15 +100,15 @@ public abstract class PointDataLayer extends
* @param milliOffset
* @return
*/
protected <T extends PluginDataObject> String getRangeSinceLatest(
long milliOffset) {
Date end = getTimes().last();
long startTime = end.getTime() - milliOffset;
Date start = new Date(startTime);
String startStr = LayerTransformer.format(start);
String endStr = LayerTransformer.format(end);
return startStr + "/" + endStr;
}
protected <T extends PluginDataObject> String getRangeSinceLatest(
long milliOffset) {
Date end = getTimes().last();
long startTime = end.getTime() - milliOffset;
Date start = new Date(startTime);
String startStr = LayerTransformer.format(start);
String endStr = LayerTransformer.format(end);
return startStr + "/" + endStr;
}
/*
* (non-Javadoc)

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 1, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.db;
import java.io.Serializable;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.db;
import java.io.Serializable;
@ -106,6 +95,10 @@ public abstract class SimpleLayer<DIMENSION extends SimpleDimension> implements
@DynamicSerializeElement
protected TreeSet<Date> times;
@XmlElement
@DynamicSerializeElement
protected boolean timesAsRanges = false;
/**
*
*/
@ -367,4 +360,19 @@ public abstract class SimpleLayer<DIMENSION extends SimpleDimension> implements
this.crs84Bounds = crs84Bounds;
}
/**
* @return the timesAsRanges
*/
public boolean isTimesAsRanges() {
return timesAsRanges;
}
/**
* @param timesAsRanges
* the timesAsRanges to set
*/
public void setTimesAsRanges(boolean timesAsRanges) {
this.timesAsRanges = timesAsRanges;
}
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 16, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.feature;
import java.util.List;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.feature;
import java.io.ByteArrayOutputStream;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 bclement Initial creation
*
*/
/**
* 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.ogc.common.feature;
import java.io.File;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 8, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.feature;
import java.io.OutputStream;

View file

@ -9,13 +9,25 @@
*/
package com.raytheon.uf.edex.ogc.common.filter;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map;
import org.apache.commons.collections.map.LRUMap;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.geospatial.ISpatialEnabled;
import com.raytheon.uf.common.geospatial.ISpatialObject;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.CoordinateFilter;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.Polygon;
/**
* TODO Add Description
* Spatial PDO Filter
*
* <pre>
*
@ -36,14 +48,34 @@ public class SpatialFilter extends AbstractPdoFilter {
EQUALS, CONTAINS, COVERS, COVEREDBY, CROSSES, DISJOINT, INTERSECTS, OVERLAPS, TOUCHES, WITHIN
};
protected Geometry geometry;
protected final Geometry geometry;
protected SpatialOp op;
protected final SpatialOp op;
private static final Polygon CRS84_BOUNDS;
private static final GeometryFactory geomFact = new GeometryFactory();
@SuppressWarnings("unchecked")
private final Map<String, Boolean> cache = new LRUMap(32);
static {
Coordinate[] coords = new Coordinate[5];
coords[0] = new Coordinate(-180, 90);
coords[1] = new Coordinate(180, 90);
coords[2] = new Coordinate(180, -90);
coords[3] = new Coordinate(-180, -90);
coords[4] = coords[0];
LinearRing shell = geomFact.createLinearRing(coords);
CRS84_BOUNDS = geomFact.createPolygon(shell, new LinearRing[0]);
}
/**
* @param geometry
* @param op
*/
* Geometry is assumed to be same CRS as PDO (CRS:84)
*
* @param geometry
* @param op
*/
public SpatialFilter(SpatialOp op, Geometry geometry) {
this.geometry = geometry;
this.op = op;
@ -58,62 +90,261 @@ public class SpatialFilter extends AbstractPdoFilter {
*/
@Override
public boolean matches(PluginDataObject pdo) {
boolean rval = true;
if (geometry == null) {
return true;
return rval;
}
ISpatialObject spat;
if (pdo instanceof ISpatialEnabled) {
if (!matchSpatial(((ISpatialEnabled) pdo).getSpatialObject())) {
return false;
}
spat = ((ISpatialEnabled) pdo).getSpatialObject();
} else if (pdo instanceof ISpatialObject) {
if (!matchSpatial((ISpatialObject) pdo)) {
return false;
}
spat = (ISpatialObject) pdo;
} else {
return rval;
}
String cacheKey = getCacheKey(spat);
synchronized (cache) {
Boolean cachedResult = cache.get(cacheKey);
if (cachedResult != null) {
return cachedResult;
}
}
if (!matchSpatial(spat)) {
rval = false;
}
return true;
synchronized (cache) {
cache.put(cacheKey, rval);
}
return rval;
}
private boolean matchSpatial(ISpatialObject spat) {
Geometry other = spat.getGeometry();
boolean rval;
switch (op) {
case EQUALS:
rval = other.equals(this.geometry);
break;
case CONTAINS:
rval = other.contains(this.geometry);
break;
case COVERS:
rval = other.covers(this.geometry);
break;
case COVEREDBY:
rval = other.coveredBy(this.geometry);
break;
case CROSSES:
rval = other.crosses(this.geometry);
break;
case DISJOINT:
rval = other.disjoint(this.geometry);
break;
case INTERSECTS:
rval = other.intersects(this.geometry);
break;
case OVERLAPS:
rval = other.overlaps(this.geometry);
break;
case TOUCHES:
rval = other.touches(this.geometry);
break;
case WITHIN:
rval = other.within(this.geometry);
break;
default:
rval = true;
break;
/**
* Generate unique key for spatial object
*
* @param spat
* @return
*/
private static String getCacheKey(ISpatialObject spat) {
CoordinateReferenceSystem crs = spat.getCrs();
String rval = (crs == null ? "" : crs.toWKT());
Geometry geom = spat.getGeometry();
if (geom != null) {
rval = rval + geom.toText();
}
return rval;
}
/**
* Get geometries from internal bounds. Takes into account any needed
* adjustments to map to OGC bounds
*
* Assumes any geographic geometry is Lon/Lat order
*
* @param spat
* @return
*/
private static Geometry[] getGeometries(ISpatialObject spatial) {
// we don't support wrapping over the poles
Geometry copy = truncateYAxis(spatial.getGeometry());
// create multiple geometries that all fit inside CRS84 bounds
Geometry diff = copy.difference(CRS84_BOUNDS);
Geometry[] rval = new Geometry[diff.getNumGeometries() + 1];
rval[0] = copy.intersection(CRS84_BOUNDS);
for (int i = 0; i < diff.getNumGeometries(); ++i) {
rval[i + 1] = convertXAxis(diff.getGeometryN(i));
}
return merge(rval);
}
/**
* Attempt to merge any intersecting geometries
*
* @param geoms
* @return
*/
private static Geometry[] merge(Geometry[] geoms) {
if (geoms.length < 2) {
return geoms;
}
LinkedList<Geometry> blobs = new LinkedList<Geometry>();
blobs.add(geoms[0]);
for (int i = 1; i < geoms.length; ++i) {
Geometry geom = geoms[i];
ListIterator<Geometry> iter = blobs.listIterator();
while (iter.hasNext()) {
Geometry blob = iter.next();
if (blob.intersects(geom)) {
geom = blob.union(geom);
iter.remove();
}
}
blobs.add(geom);
}
return blobs.toArray(new Geometry[blobs.size()]);
}
/**
* Truncate geometry Y coordinates to fit between -90 and 90
*
* @param geom
*/
private static Geometry truncateYAxis(Geometry geom) {
Geometry rval = (Geometry) geom.clone();
rval.apply(new CoordinateFilter() {
@Override
public void filter(Coordinate coord) {
if (coord.y > 90) {
coord.y = 90;
} else if (coord.y < -90) {
coord.y = -90;
}
}
});
rval.geometryChanged();
return rval;
}
/**
* Convert geometry X coordinates to fit between -180 and 180
*
* @param geom
* @return
*/
private static Geometry convertXAxis(Geometry geom) {
Geometry rval = (Geometry) geom.clone();
rval.apply(new CoordinateFilter() {
@Override
public void filter(Coordinate coord) {
coord.x = ((coord.x + 180) % 360) - 180;
}
});
geom.geometryChanged();
return rval;
}
/**
* Return true if spatial object matches the geographic operator
*
* @param spat
* @return
*/
private boolean matchSpatial(ISpatialObject spat) {
if (spat.getGeometry() == null) {
return false;
}
Geometry[] geometries = getGeometries(spat);
return matchGeom(geometries);
}
protected static interface ForEach {
public boolean eval(Geometry other);
}
/**
* Return true if geometry matches the geographic operator
*
* @param other
* @return
*/
private boolean matchGeom(Geometry[] others) {
switch (op) {
case EQUALS:
return all(new ForEach() {
public boolean eval(Geometry other) {
return other.equals(geometry);
}
}, others);
case CONTAINS:
return any(new ForEach() {
public boolean eval(Geometry other) {
return other.contains(geometry);
}
}, others);
case COVERS:
return any(new ForEach() {
public boolean eval(Geometry other) {
return other.covers(geometry);
}
}, others);
case COVEREDBY:
return all(new ForEach() {
public boolean eval(Geometry other) {
return other.coveredBy(geometry);
}
}, others);
case CROSSES:
return any(new ForEach() {
public boolean eval(Geometry other) {
return other.crosses(geometry);
}
}, others);
case DISJOINT:
return all(new ForEach() {
public boolean eval(Geometry other) {
return other.disjoint(geometry);
}
}, others);
case INTERSECTS:
return any(new ForEach() {
public boolean eval(Geometry other) {
return other.intersects(geometry);
}
}, others);
case OVERLAPS:
return any(new ForEach() {
public boolean eval(Geometry other) {
return other.overlaps(geometry);
}
}, others);
case TOUCHES:
return any(new ForEach() {
public boolean eval(Geometry other) {
return other.touches(geometry);
}
}, others);
case WITHIN:
return all(new ForEach() {
public boolean eval(Geometry other) {
return other.within(geometry);
}
}, others);
default:
return true;
}
}
/**
* Return true if any of others evaluate true
*
* @param fe
* @param others
* @return
*/
private boolean any(ForEach fe, Geometry[] others) {
for (Geometry other : others) {
if (fe.eval(other)) {
return true;
}
}
return false;
}
/**
* Return true if all of other evaluate true
*
* @param fe
* @param others
* @return
*/
private boolean all(ForEach fe, Geometry[] others) {
for (Geometry other : others) {
if (!fe.eval(other)) {
return false;
}
}
return true;
}
/**
* @return the geometry
*/

View file

@ -16,7 +16,7 @@ import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
/**
* TODO Add Description
* Temporal PDO Filter
*
* <pre>
*
@ -34,7 +34,7 @@ import com.raytheon.uf.common.time.TimeRange;
public class TemporalFilter extends AbstractPdoFilter {
public static enum TimeOp {
After, Before, Begins, BegunBy, TContains, During, TEquals, TOverlaps, Meets, OverlappedBy, MetBy, Ends, EndedBy
AnyInteracts, After, Before, Begins, BegunBy, TContains, During, TEquals, TOverlaps, Meets, OverlappedBy, MetBy, Ends, EndedBy
};
protected DataTime time;
@ -70,6 +70,14 @@ public class TemporalFilter extends AbstractPdoFilter {
Date t2Start = range.getStart();
Date t2End = range.getEnd();
switch (op) {
case AnyInteracts:
if (isRange(time)) {
return beforeOrEqual(t1Start, t2End)
&& afterOrEqual(t1End, t2Start);
} else {
return beforeOrEqual(t1Start, t2Start)
&& afterOrEqual(t1End, t2End);
}
case After:
return t1Start.after(t2End);
case Before:
@ -82,6 +90,7 @@ public class TemporalFilter extends AbstractPdoFilter {
return t1Start.equals(t2Start);
}
}
break;
case BegunBy:
if (isRange(other)) {
if (isRange(time)) {
@ -90,10 +99,12 @@ public class TemporalFilter extends AbstractPdoFilter {
return t1Start.equals(t2Start);
}
}
break;
case During:
if (isRange(time)) {
return t1Start.after(t2Start) && t1End.before(t2End);
}
break;
case EndedBy:
if (isRange(other)) {
if (isRange(time)) {
@ -102,6 +113,7 @@ public class TemporalFilter extends AbstractPdoFilter {
return t1End.equals(t2End);
}
}
break;
case Ends:
if (isRange(time)) {
if (isRange(other)) {
@ -110,19 +122,23 @@ public class TemporalFilter extends AbstractPdoFilter {
return t1End.equals(t2End);
}
}
break;
case Meets:
if (isRange(other) && isRange(time)) {
return t1End.equals(t2Start);
}
break;
case MetBy:
if (isRange(other) && isRange(time)) {
return t1Start.equals(t2End);
}
break;
case OverlappedBy:
if (isRange(other) && isRange(time)) {
return t1Start.after(t2Start) && t1Start.before(t2End)
&& t1End.after(t2End);
}
break;
case TContains:
if (isRange(other)) {
if (isRange(time)) {
@ -131,6 +147,7 @@ public class TemporalFilter extends AbstractPdoFilter {
return t1Start.before(t2Start) && t1End.after(t2End);
}
}
break;
case TEquals:
if (!(isRange(other) ^ isRange(time))) {
return t1Start.equals(t2Start) && t1End.equals(t2End);
@ -140,11 +157,30 @@ public class TemporalFilter extends AbstractPdoFilter {
return t1Start.before(t2Start) && t1End.after(t2Start)
&& t1End.before(t2End);
}
break;
}
return false;
}
/**
* @param one
* @param two
* @return true if one is before or equal to two
*/
public static boolean beforeOrEqual(Date one, Date two) {
return one.equals(two) || one.before(two);
}
/**
* @param one
* @param two
* @return true if one is after or equal to two
*/
public static boolean afterOrEqual(Date one, Date two) {
return one.equals(two) || one.after(two);
}
public static boolean isRange(DataTime time) {
return time.getUtilityFlags().contains(DataTime.FLAG.PERIOD_USED);
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 26, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.gml3_1_1;
import java.text.ParseException;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 25, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.gml3_1_1;
import net.opengis.gml.v_3_1_1.AbstractGeometryType;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 25, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.gml3_1_1;
import java.math.BigDecimal;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 26, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.gml3_2_1;
import java.text.ParseException;

View file

@ -1,39 +1,32 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 25, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.gml3_2_1;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.xml.bind.JAXBElement;
@ -61,6 +54,7 @@ import net.opengis.gml.v_3_2_1.PointPropertyType;
import net.opengis.gml.v_3_2_1.PointType;
import net.opengis.gml.v_3_2_1.PolygonType;
import org.apache.commons.lang.ArrayUtils;
import org.geotools.geometry.jts.JTS;
import com.vividsolutions.jts.geom.Coordinate;
@ -89,6 +83,17 @@ public class GeometryConverter {
protected final ObjectFactory gmlFactory = new ObjectFactory();
private static final String DIGIT_STR = "Ee-.0123456789";
private static final Set<Character> DIGIT_SET;
static {
char[] arr = DIGIT_STR.toCharArray();
HashSet<Character> set = new HashSet<Character>(
Arrays.asList(ArrayUtils.toObject(arr)));
DIGIT_SET = Collections.unmodifiableSet(set);
}
/**
* Supports geometry collection, polygon, point and linestring
*
@ -886,7 +891,7 @@ public class GeometryConverter {
* @return true if c is a valid character used in representing a number
*/
protected boolean isNumber(Character c) {
return Character.isDigit(c);
return DIGIT_SET.contains(c);
}
/**

View file

@ -29,11 +29,16 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import com.raytheon.uf.edex.ogc.common.stats.OgcStatsRecorder;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.log.cxf.RequestLogController;
import com.raytheon.uf.edex.ogc.common.stats.IStatsRecorder;
import com.raytheon.uf.edex.ogc.common.stats.OperationType;
import com.raytheon.uf.edex.ogc.common.stats.ServiceType;
import com.raytheon.uf.edex.ogc.common.stats.StatsRecorderFinder;
/**
* TODO - Class comment here
* HTTP Camel Processor for OGC REST Services
*
* <pre>
*
@ -57,6 +62,8 @@ public class OgcHttpEndpoint implements Processor {
protected IOgcHttpPooler pool;
protected IUFStatusHandler log = UFStatus.getHandler(this.getClass());
/**
*
*/
@ -89,9 +96,20 @@ public class OgcHttpEndpoint implements Processor {
// TODO get service from request somehow?? remove time and duration
// calculation from critical path
OgcStatsRecorder statRecorder = StatsRecorderFinder.find();
IStatsRecorder statRecorder = StatsRecorderFinder.find();
statRecorder.recordRequest(System.currentTimeMillis(),
System.nanoTime() - start, "OGCRest", true);
System.nanoTime() - start, ServiceType.OGC, OperationType.QUERY, true);
//TODO this is part of the incoming request log, the rest is usually in CXF
//which is not hooked up here. Fill in cxf portion of request logging.
if (RequestLogController.getInstance().shouldLogRequestsInfo() &&
log.isPriorityEnabled(RequestLogController.getInstance().getRequestLogLevel())) {
String requestLog = "";
requestLog += "Successfully processed request from " + ex.getFromRouteId() + ". ";
requestLog += "Duration of " + (System.nanoTime() - start/1000000000.0) + "s.";
log.handle(RequestLogController.getInstance().getRequestLogLevel(),
requestLog);
}
pool.returnObject(id, handler);
}

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.
**/
/**
*
*/

View file

@ -1,27 +1,22 @@
/**********************************************************************
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* The following software products were developed by Raytheon:
* 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.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* 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.
**/
/**
*
*/

View file

@ -1,26 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* 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.ogc.common.http;
import java.io.InputStream;

View file

@ -35,6 +35,8 @@ import java.io.OutputStream;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@ -65,10 +67,14 @@ import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
*/
public class OgcJaxbManager extends JAXBManager {
private final JAXBContext jaxbContext;
protected final JAXBContext jaxbContext;
protected static final int QUEUE_SIZE = 10;
protected final Queue<Unmarshaller> unmarshallers = new ConcurrentLinkedQueue<Unmarshaller>();
protected final Queue<Marshaller> marshallers = new ConcurrentLinkedQueue<Marshaller>();
protected volatile int unmarshallersCreated = 0;
protected volatile int marshallersCreated = 0;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 28, 2012 bclement Initial creation
*
*/
/**
* 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.ogc.common.output;
import java.awt.image.RenderedImage;

View file

@ -26,7 +26,6 @@ import org.geotools.referencing.CRS;
import org.geotools.referencing.crs.DefaultCompoundCRS;
import org.opengis.geometry.DirectPosition;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.GeographicCRS;
import org.opengis.referencing.crs.SingleCRS;
import org.opengis.referencing.cs.CoordinateSystem;
import org.opengis.referencing.cs.CoordinateSystemAxis;
@ -55,6 +54,8 @@ import com.vividsolutions.jts.geom.Coordinate;
*/
public class BoundingBoxUtil {
public static Unit<?> FL_UNIT = VerticalCoordinate.FLIGHT_LEVEL_UNIT;
/**
* Split 3D envelope into composite parts
*
@ -266,13 +267,13 @@ public class BoundingBoxUtil {
*/
private static void checkGeoBounds(ReferencedEnvelope env)
throws OgcException {
if (env.getCoordinateReferenceSystem() instanceof GeographicCRS) {
if (env.getMinX() < -180 || env.getMaxX() > 180
|| env.getMinY() < -90 || env.getMaxY() > 90) {
throw new OgcException(Code.InvalidParameterValue,
"Geo bounds not in range. Check axis order");
}
}
// if (env.getCoordinateReferenceSystem() instanceof GeographicCRS) {
// if (env.getMinX() < -180 || env.getMaxX() > 180
// || env.getMinY() < -90 || env.getMaxY() > 90) {
// throw new OgcException(Code.InvalidParameterValue,
// "Geo bounds not in range. Check axis order");
// }
// }
}
/**

View file

@ -1,39 +1,29 @@
/*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 17, 2012 bclement Initial creation
*
*/
/**
* 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.ogc.common.spatial;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.measure.quantity.Quantity;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import org.apache.commons.collections.map.LRUMap;
@ -51,6 +41,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.GeographicCRS;
import org.opengis.referencing.cs.AxisDirection;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.edex.ogc.common.OgcException;
import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate.Reference;
@ -137,17 +128,31 @@ public class CrsLookup {
// check if unit string matches reference level
ref = Reference.fromAbbreviation(m.group(2).toUpperCase());
}
AxisDirection dir = ref.equals(Reference.PRESSURE_LEVEL) ? AxisDirection.DOWN
return create3d(m.group(0), base2d, units, ref);
}
/**
* Create 3D CRS from horizontal and vertical components
*
* @param base2d
* @param vertUnits
* @param vertRef
* @return
*/
protected static CoordinateReferenceSystem create3d(String name,
CoordinateReferenceSystem base2d, Unit<?> vertUnits,
Reference vertRef) {
AxisDirection dir = vertRef.equals(Reference.PRESSURE_LEVEL) ? AxisDirection.DOWN
: AxisDirection.UP;
DefaultCoordinateSystemAxis axis = new DefaultCoordinateSystemAxis(
ref.longName, dir, units);
vertRef.longName, dir, vertUnits);
DefaultVerticalCS cs = new DefaultVerticalCS(axis);
DefaultVerticalDatum datum = new DefaultVerticalDatum(ref.longName,
DefaultVerticalDatum datum = new DefaultVerticalDatum(vertRef.longName,
DefaultVerticalDatum
.getVerticalDatumTypeFromLegacyCode(ref.datumType));
DefaultVerticalCRS vertCrs = new DefaultVerticalCRS(ref.longName,
.getVerticalDatumTypeFromLegacyCode(vertRef.datumType));
DefaultVerticalCRS vertCrs = new DefaultVerticalCRS(vertRef.longName,
datum, cs);
return new DefaultCompoundCRS(m.group(0), base2d, vertCrs);
return new DefaultCompoundCRS(name, base2d, vertCrs);
}
/**
@ -192,6 +197,10 @@ public class CrsLookup {
|| crs.equalsIgnoreCase("epsg:3857")) {
return getGoogleCrs();
}
if (crs.equalsIgnoreCase("epsg:4979")) {
return create3d(crs, MapUtil.LATLON_PROJECTION, SI.METER,
Reference.ABOVE_ELLIPSOID);
}
return CRS.decode(crs, true);
}
@ -231,7 +240,7 @@ public class CrsLookup {
// OGC URN without version?
rval = constructCode(parts[4], parts[5]);
} else {
// unkown form, try it anyway
// unknown form, try it anyway
rval = crs;
}
return rval.toLowerCase();
@ -273,8 +282,12 @@ public class CrsLookup {
*/
protected static String createCrsURN(CoordinateReferenceSystem crs) {
ReferenceIdentifier id = crs.getIdentifiers().iterator().next();
return String.format("urn:ogc:def:crs:%s::%s", id.getCodeSpace(),
id.getCode());
String codeSpace = id.getCodeSpace();
String code = id.getCode();
if (codeSpace.equalsIgnoreCase("crs") && code.equalsIgnoreCase("84")) {
return "urn:ogc:def:crs:OGC:2:84";
}
return String.format("urn:ogc:def:crs:%s::%s", codeSpace, code);
}
/**

View file

@ -49,7 +49,7 @@ public class VerticalCoordinate implements Comparable<VerticalCoordinate> {
2005, "gravity-related height"), ABOVE_ELLIPSOID("AEH", 2002,
"ellipsoidal height"), PRESSURE_LEVEL("PL", 2003,
"barometric altitude"), FLIGHT_LEVEL("FL", 2003, "flight level"), UNKNOWN(
"", 2000, "unkown");
"", 2000, "unknown");
private static final Map<String, Reference> ABB_MAP;
@ -95,8 +95,8 @@ public class VerticalCoordinate implements Comparable<VerticalCoordinate> {
private VerticalCoordinate(double min, double max, Unit<?> units,
Reference ref, boolean isRange) {
this.min = min;
this.max = max;
this.min = Math.min(min, max);
this.max = Math.max(min, max);
this.units = units;
this.ref = ref;
this.range = isRange;

View file

@ -9,6 +9,8 @@
*/
package com.raytheon.uf.edex.ogc.common.spatial;
import javax.measure.unit.Unit;
/**
* Adapter for vertical spatial information
*
@ -38,4 +40,11 @@ public interface VerticalEnabled<T> {
*/
public Class<T> getSupportedClass();
/**
* default unit for vertical coordinates
*
* @return null if there is no reliable default
*/
public Unit<?> getDefaultVerticalUnit();
}

View file

@ -0,0 +1,72 @@
/**
* 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.ogc.common.stats;
/**
* interface for recording ogc service stats
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 25, 2013 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public interface IStatsRecorder {
/**
* Records the request that was made with some basic raw information about
* it.
*
* @param time
* time of observation in milliseconds
* @param duration
* duration of request in nanoseconds
* @param service
* Id for service
* @param success
* indicates if the request being timed was successful
*/
public void recordRequest(long time, long duration, ServiceType service,
OperationType op, boolean success);
/**
* Retrieve statistic about service
*
* @param service
* @return
*/
public long getMinRequestTime(ServiceType service, OperationType op);
/**
* Retrieve statistic about service
*
* @param service
* @return
*/
public long getMaxRequestTime(ServiceType service, OperationType op);
/**
* Retrieve statistic about service
*
* @param service
* @return
*/
public long getAvgRequestTime(ServiceType service, OperationType op);
}

View file

@ -26,54 +26,32 @@ package com.raytheon.uf.edex.ogc.common.stats;
* @author bclement
* @version 1.0
*/
public class NoopStatsRecorder implements OgcStatsRecorder {
public class NoopStatsRecorder implements IStatsRecorder {
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.edex.ogc.common.OgcStatsRecorder#recordRequest(long,
* long, java.lang.String, boolean)
*/
@Override
public void recordRequest(long time, long duration, String service,
boolean success) {
// do nothing
public void recordRequest(long time, long duration, ServiceType service,
OperationType op, boolean success) {
// TODO Auto-generated method stub
//do nothing
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.ogc.common.OgcStatsRecorder#getMinRequestTime(java
* .lang.String)
*/
@Override
public long getMinRequestTime(String service) {
public long getMinRequestTime(ServiceType service, OperationType op) {
// TODO Auto-generated method stub
return 0;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.ogc.common.OgcStatsRecorder#getMaxRequestTime(java
* .lang.String)
*/
@Override
public long getMaxRequestTime(String service) {
public long getMaxRequestTime(ServiceType service, OperationType op) {
// TODO Auto-generated method stub
return 0;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.ogc.common.OgcStatsRecorder#getAvgRequestTime(java
* .lang.String)
*/
@Override
public long getAvgRequestTime(String service) {
public long getAvgRequestTime(ServiceType service, OperationType op) {
// TODO Auto-generated method stub
return 0;
}
}

View file

@ -0,0 +1,25 @@
/**
* 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.ogc.common.stats;
public enum OperationType {
STORE, QUERY, DELETE,
// special case for encompassing all values
OPEN;
public static OperationType permissiveValueOf(String name) {
for (OperationType e : values()) {
if (e.name().equals(name)) {
return e;
}
}
return null;
}
}

View file

@ -0,0 +1,33 @@
/**
* 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.ogc.common.stats;
/**
* Enumeration representing the types of operations that statistics are recorded
* for within the IGCServiceRecorder
*
* @author behemmi
*
*/
public enum ServiceType {
WFS, WCS, OGC, REGISTRY,
// special case for encompassing all values
OPEN;
public static ServiceType permissiveValueOf(String name) {
for (ServiceType e : values()) {
if (e.name().equals(name)) {
return e;
}
}
return null;
}
}

View file

@ -31,7 +31,7 @@ import com.raytheon.uf.edex.core.EDEXUtil;
*/
public class StatsRecorderFinder {
private static volatile OgcStatsRecorder recorder = null;
private static volatile IStatsRecorder recorder = null;
private static final Object recorderMutex = new Object();
@ -40,17 +40,17 @@ public class StatsRecorderFinder {
*
* @return
*/
public static OgcStatsRecorder find() {
public static IStatsRecorder find() {
if (recorder == null) {
synchronized (recorderMutex) {
if (recorder == null) {
ApplicationContext ctx = EDEXUtil.getSpringContext();
String[] beans = ctx
.getBeanNamesForType(OgcStatsRecorder.class);
.getBeanNamesForType(IStatsRecorder.class);
if (beans.length == 0) {
recorder = new NoopStatsRecorder();
} else {
recorder = (OgcStatsRecorder) ctx.getBean(beans[0]);
recorder = (IStatsRecorder) ctx.getBean(beans[0]);
}
}
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 3, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.ogc.common.time;
import java.util.ArrayList;

View file

@ -65,9 +65,9 @@ public class GribLayerCollector extends
} else if (GribDimension.PARAM_DIM.equals(name)) {
values.add(getParameter(rec));
} else {
log.warn("Unkown grib dimension: " + name);
log.warn("Unknown grib dimension: " + name);
}
}
}
}
/**

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 21, 2012 bclement Initial creation
*
*/
* 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.Comparator;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 30, 2011 jelkins Initial creation
*
*/
* 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.ArrayList;

View file

@ -1,40 +1,28 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 16, 2011 jelkins Initial creation
*
*/
* 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.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.PluginProperties;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
@ -52,10 +40,10 @@ import com.raytheon.uf.edex.wms.styling.ICoverageStyleProvider;
* @version 1.0
*/
public class GribWmsSource extends
DefaultWmsSource<GribDimension, GridParamLayer> {
DefaultWmsSource<GribDimension, GridParamLayer, GridRecord> {
protected ColormapStyleProvider styler = new ColormapStyleProvider(
"grib_style_library.xml", "Grid/Default");
protected ColormapStyleProvider<GridRecord> styler = new GridStyleProvider(
this, "Grid/Default");
public GribWmsSource(PluginProperties props,
LayerTransformer<GribDimension, GridParamLayer> transformer)
@ -71,9 +59,8 @@ public class GribWmsSource extends
* java.lang.String, java.lang.String, java.util.Map)
*/
@Override
protected PluginDataObject getRecord(String layer, String time,
String elevation, Map<String, String> dimensions,
Map<String, String> levelUnits) throws WmsException {
protected GridRecord getRecord(String layer, String time, String elevation,
Map<String, String> dimensions) throws WmsException {
LayerTransformer<GribDimension, GridParamLayer> transformer;
List<GridRecord> res;
try {
@ -108,7 +95,7 @@ public class GribWmsSource extends
* .String)
*/
@Override
protected ICoverageStyleProvider getStyleProvider(String layer)
protected ICoverageStyleProvider<GridRecord> getStyleProvider(String layer)
throws WmsException {
return styler;
}

View file

@ -76,11 +76,18 @@ public class GridCompositeLayer extends GribLayer {
@Override
public Set<GribDimension> getDimensions() {
TreeSet<GribDimension> rval = new TreeSet<GribDimension>();
HashMap<String, GribDimension> byDim = new HashMap<String, GribDimension>();
for (Entry<String, TreeSet<GribDimension>> e : dimensions.entrySet()) {
rval.addAll(e.getValue());
for (GribDimension dim : e.getValue()) {
GribDimension aggregate = byDim.get(dim.getName());
if (aggregate == null) {
byDim.put(dim.getName(), dim);
continue;
}
aggregate.getValues().addAll(dim.getValues());
}
}
return rval;
return new TreeSet<GribDimension>(byDim.values());
}
/*

View file

@ -10,6 +10,7 @@
package com.raytheon.uf.edex.plugin.grib.ogc;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.edex.plugin.dataset.urn.CFNameLookup;
import com.raytheon.uf.edex.wcs.reg.IFieldAdapted;
/**
@ -39,7 +40,9 @@ public class GridFieldAdapter implements IFieldAdapted<GridRecord> {
*/
@Override
public String getCoverageField(GridRecord record) {
return record.getInfo().getParameter().getAbbreviation();
CFNameLookup lookup = CFNameLookup.getInstance();
String abbr = record.getInfo().getParameter().getAbbreviation();
return lookup.getCFFromNCEP(abbr);
}
/*

View file

@ -0,0 +1,112 @@
/**
* 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;
}
}

View file

@ -10,6 +10,7 @@
package com.raytheon.uf.edex.plugin.grib.ogc;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.level.Level;
@ -86,4 +87,15 @@ public class GridVerticalEnabler implements VerticalEnabled<GridRecord> {
return GridRecord.class;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.edex.ogc.common.spatial.VerticalEnabled#
* getDefaultVerticalUnit()
*/
@Override
public Unit<?> getDefaultVerticalUnit() {
return null;
}
}

View file

@ -21,7 +21,6 @@ Require-Bundle: com.raytheon.uf.edex.ogc.common;bundle-version="1.0.0",
ogc.tools.gml;bundle-version="1.0.2",
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
com.raytheon.uf.edex.wms;bundle-version="1.0.0",
com.raytheon.uf.common.time;bundle-version="1.12.1174",
com.raytheon.uf.edex.pointdata;bundle-version="1.12.1174",
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174"

View file

@ -20,11 +20,6 @@
<constructor-arg ref="madisWfsSource" />
</bean>
<bean id="madisWmsSource" class="com.raytheon.uf.edex.plugin.madis.ogc.MadisWmsSource" >
<constructor-arg ref="madisProperties" />
<constructor-arg ref="madisLayerTransformer"/>
</bean>
<bean id="madisLayerTransformer" class="com.raytheon.uf.edex.ogc.common.db.LayerTransformer" >
<constructor-arg value="madis" />
<constructor-arg ref="madisLayerCollector" />

View file

@ -1,105 +0,0 @@
package com.raytheon.uf.edex.plugin.madis.ogc;
/**
* 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.
**/
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.PluginProperties;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.edex.ogc.common.db.LayerTransformer;
import com.raytheon.uf.edex.wms.WmsException;
import com.raytheon.uf.edex.wms.reg.PointDataWmsSource;
import com.raytheon.uf.edex.wms.styling.FeatureStyleProvider;
/**
* MADIS WMS Source
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 18, 2013 2097 dhladky Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class MadisWmsSource extends
PointDataWmsSource<MadisDimension, MadisLayer> {
private static final String geometryField = "location.location";
private static final FeatureStyleProvider styler = new FeatureStyleProvider(
"sld/madis/defaultMadis.sld");
/**
* @param props
* @param key
* @param layerTable
* @param styles
* @throws Exception
*/
public MadisWmsSource(PluginProperties props,
LayerTransformer<MadisDimension, MadisLayer> transformer)
throws Exception {
super(props, "madis", transformer, new MadisFeatureFactory());
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.wms.reg.FeatureWmsSource#getGeometryField(java.lang
* .String)
*/
@Override
protected String getGeometryField(String layer) {
// madis has only one layer
return geometryField;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.wms.reg.FeatureWmsSource#getCRS(java.lang.String)
*/
@Override
protected CoordinateReferenceSystem getCRS(String layer) {
return MapUtil.LATLON_PROJECTION;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.wms.reg.FeatureWmsSource#getStyleProvider(java.lang
* .String)
*/
@Override
protected FeatureStyleProvider getStyleProvider(String layer)
throws WmsException {
return styler;
}
}

View file

@ -18,7 +18,6 @@ Require-Bundle: org.geotools;bundle-version="2.6.4",
org.hibernate;bundle-version="1.0.0",
com.raytheon.uf.edex.database;bundle-version="1.0.0",
com.raytheon.uf.edex.core;bundle-version="1.12.1174",
com.raytheon.uf.edex.wms;bundle-version="1.0.0",
com.raytheon.uf.common.util;bundle-version="1.12.1174",
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
javax.persistence;bundle-version="1.0.0",

View file

@ -20,11 +20,6 @@
<constructor-arg ref="metarWfsSource" />
</bean>
<bean id="metarWmsSource" class="com.raytheon.uf.edex.plugin.obs.ogc.metar.MetarWmsSource" >
<constructor-arg ref="obsProperties" />
<constructor-arg ref="metarLayerTransformer"/>
</bean>
<bean id="metarLayerTransformer" class="com.raytheon.uf.edex.ogc.common.db.LayerTransformer" >
<constructor-arg value="metar" />
<constructor-arg ref="metarLayerCollector" />

View file

@ -1,108 +0,0 @@
/*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 3, 2011 bclement Initial creation
*
*/
package com.raytheon.uf.edex.plugin.obs.ogc.metar;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.PluginProperties;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.edex.ogc.common.db.DefaultPointDataDimension;
import com.raytheon.uf.edex.ogc.common.db.LayerTransformer;
import com.raytheon.uf.edex.wms.WmsException;
import com.raytheon.uf.edex.wms.reg.PointDataWmsSource;
import com.raytheon.uf.edex.wms.styling.FeatureStyleProvider;
/**
*
* @author bclement
* @version 1.0
*/
public class MetarWmsSource extends
PointDataWmsSource<DefaultPointDataDimension, MetarLayer> {
private static final String geometryField = "location.location";
private static final FeatureStyleProvider styler = new FeatureStyleProvider(
"sld/metar/defaultMetar.sld");
/**
* @param props
* @param key
* @param layerTable
* @param styles
* @throws Exception
*/
public MetarWmsSource(PluginProperties props,
LayerTransformer<DefaultPointDataDimension, MetarLayer> transformer)
throws Exception {
super(props, "metar", transformer, new MetarFeatureFactory());
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.wms.reg.FeatureWmsSource#getGeometryField(java.lang
* .String)
*/
@Override
protected String getGeometryField(String layer) {
// metar has only one layer
return geometryField;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.wms.reg.FeatureWmsSource#getCRS(java.lang.String)
*/
@Override
protected CoordinateReferenceSystem getCRS(String layer) {
return MapUtil.LATLON_PROJECTION;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.edex.wms.reg.FeatureWmsSource#getStyleProvider(java.lang
* .String)
*/
@Override
protected FeatureStyleProvider getStyleProvider(String layer)
throws WmsException {
return styler;
}
}

View file

@ -25,7 +25,8 @@ Require-Bundle: com.raytheon.uf.edex.ogc.common;bundle-version="1.0.0",
com.raytheon.uf.edex.plugin.unitconverter;bundle-version="1.0.0",
com.raytheon.uf.common.spatial;bundle-version="1.0.0",
org.eclipse.jetty;bundle-version="7.6.9",
com.raytheon.uf.common.status;bundle-version="1.12.1174"
com.raytheon.uf.common.status;bundle-version="1.12.1174",
com.raytheon.uf.edex.log;bundle-version="1.12.1174"
Export-Package: com.raytheon.uf.edex.wcs,
com.raytheon.uf.edex.wcs.format,
com.raytheon.uf.edex.wcs.provider,

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.uf.edex.wcs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,8 @@
#Thu Feb 16 10:57:42 CST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,124 @@
/**
* 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.wcs;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import org.apache.commons.lang.BooleanUtils;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
/**
* WCS configuration
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 9, 2013 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class WcsConfig {
public static final String FORCE_KM_BBOX = "force.km.altitude";
private static final IUFStatusHandler log = UFStatus
.getHandler(WcsConfig.class);
private static Properties props = null;
static {
LocalizationFile confFile = findConfigFile();
if (confFile == null) {
log.warn("Unable to find custom id mapping properties");
props = new Properties();
} else {
props = loadConfig(confFile);
}
}
/**
* Find configuration file in localization
*
* @return null if not found
*/
private static LocalizationFile findConfigFile() {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext[] searchHierarchy = pm
.getLocalSearchHierarchy(LocalizationType.EDEX_STATIC);
for (LocalizationContext ctx : searchHierarchy) {
LocalizationFile localizationFile = pm.getLocalizationFile(ctx,
"wcs" + IPathManager.SEPARATOR + "wcsConfig.properties");
if (localizationFile.exists()) {
return localizationFile;
}
}
return null;
}
/**
* Load map from config
*
* @param idMapFile
* @return
*/
private static Properties loadConfig(LocalizationFile idMapFile) {
Properties props = new Properties();
File file = idMapFile.getFile();
try {
props.load(new FileInputStream(file));
} catch (Exception e) {
log.error("Unable to load WCS config: " + file, e);
}
return props;
}
/**
* Get property from config
*
* @param key
* @return null if property not set
*/
public static String getProperty(String key) {
if (props == null) {
return null;
}
return props.getProperty(key);
}
/**
* Return boolean value of property
*
* @param key
* @return false if property not set
*/
public static boolean isProperty(String key) {
if (props == null) {
return false;
}
return BooleanUtils.toBoolean(props.getProperty(key));
}
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 30, 2011 ekladstrup Initial creation
*
*/
/**
* 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.wcs;
import com.raytheon.uf.common.datastorage.records.IDataRecord;

View file

@ -22,6 +22,7 @@ package com.raytheon.uf.edex.wcs;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@ -208,28 +209,29 @@ public class WcsHttpHandler extends OgcHttpHandler {
return null;
}
private OgcServiceInfo<WcsOpType> getServiceInfo(HttpServletRequest request) {
// FIXME get address from spring
int port = request.getServerPort();
String base = "http://" + request.getServerName();
if (port != 80) {
base += ":" + port;
}
base += request.getPathInfo() + "?service=wcs";
OgcServiceInfo<WcsOpType> rval = new OgcServiceInfo<WcsOpType>(base);
rval.addOperationInfo(getOp(base, base,
WcsOpType.GetCapabilities));
rval.addOperationInfo(getOp(base, base,
WcsOpType.DescribeCoverage));
rval.addOperationInfo(getOp(base, base,
WcsOpType.GetCoverage));
private OgcServiceInfo<WcsOpType> getServiceInfo(HttpServletRequest request) {
// FIXME get address from spring
int port = request.getServerPort();
String base = "http://" + request.getServerName();
if (port != 80) {
base += ":" + port;
}
base += request.getPathInfo() + "?service=wcs";
OgcServiceInfo<WcsOpType> rval = new OgcServiceInfo<WcsOpType>(base);
rval.addOperationInfo(getOp(base, base, WcsOpType.GetCapabilities,
request.getServerName()));
rval.addOperationInfo(getOp(base, base, WcsOpType.DescribeCoverage,
request.getServerName()));
rval.addOperationInfo(getOp(base, base, WcsOpType.GetCoverage,
request.getServerName()));
return rval;
}
return rval;
}
protected OgcOperationInfo<WcsOpType> getOp(String get, String post,
WcsOpType type) {
WcsOpType type, String host) {
OgcOperationInfo<WcsOpType> rval = new OgcOperationInfo<WcsOpType>(type);
rval.setHttpBaseHostname(host);
// FIXME get version from provider
rval.setHttpGetRes(get);
rval.setHttpPostRes(post);
@ -349,7 +351,7 @@ public class WcsHttpHandler extends OgcHttpHandler {
String[] identifiers = getHeaderArr(IDENTIFIERS, headers);
if (identifiers != null) {
rval.setIdentifiers(identifiers);
rval.setIdentifiers(Arrays.asList(identifiers));
}
return rval;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 22, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs;
import java.util.LinkedList;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 22, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs;
import java.util.LinkedList;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 3, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.format;
import java.io.IOException;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 23, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.format;
import java.io.File;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 3, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.format;
import java.io.File;
@ -42,6 +31,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicLong;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -109,6 +99,8 @@ public class NetCdfFormatter implements IWcsDataFormatter {
private final BasicFileStore store;
private static final AtomicLong STORAGE_ID = new AtomicLong();
public NetCdfFormatter(BasicFileStore store) {
this.store = store;
}
@ -637,6 +629,7 @@ public class NetCdfFormatter implements IWcsDataFormatter {
do {
HashCodeBuilder builder = new HashCodeBuilder();
builder.append(name).append(System.currentTimeMillis());
builder.append(STORAGE_ID.incrementAndGet());
String hash = Integer.toHexString(builder.toHashCode());
rval = name + hash + ".nc";
} while (store.getFile(rval) != null);

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.provider;
import static com.raytheon.uf.edex.wcs.provider.WcsJaxbUtils.getAsLangString;
@ -151,7 +140,7 @@ public class CapabilitiesBuilder {
if (cov.getCrs() != null && cov.getCrs().size() > 0) {
for (String crs : cov.getCrs()) {
jaxbList.add(owsFactory.createSupportedCRS(crs));
jaxbList.add(wcsFactory.createCoverageSummaryTypeSupportedCRS(crs));
}
}
if (cov.getIdentifier() != null) {

View file

@ -0,0 +1,148 @@
/**
* 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.wcs.provider;
import java.io.File;
import java.io.FileInputStream;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
/**
* Mapping of custom identifiers to internally generated URNs
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 31, 2013 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class CustomIdMap {
private static final Map<String, String> externalToInternal;
private static final Map<String, String> internalToExternal;
private static final IUFStatusHandler log = UFStatus
.getHandler(CustomIdMap.class);
static {
LocalizationFile idMapFile = findConfigFile();
Map<String, String> map;
if (idMapFile == null) {
log.warn("Unable to find custom id mapping properties");
map = new HashMap<String, String>(0);
} else {
map = loadConfig(idMapFile);
}
externalToInternal = Collections.unmodifiableMap(map);
internalToExternal = Collections.unmodifiableMap(reverseMap(map));
}
/**
* Find configuration file in localization
*
* @return null if not found
*/
private static LocalizationFile findConfigFile() {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext[] searchHierarchy = pm
.getLocalSearchHierarchy(LocalizationType.EDEX_STATIC);
for (LocalizationContext ctx : searchHierarchy) {
LocalizationFile localizationFile = pm.getLocalizationFile(ctx,
"wcs" + IPathManager.SEPARATOR
+ "wcsIdentifier.properties");
if (localizationFile.exists()) {
return localizationFile;
}
}
return null;
}
/**
* Load map from config
*
* @param idMapFile
* @return
*/
private static Map<String, String> loadConfig(LocalizationFile idMapFile) {
Properties props = new Properties();
File file = idMapFile.getFile();
try {
props.load(new FileInputStream(file));
} catch (Exception e) {
log.error("Unable to load WCS id map: " + file, e);
return new HashMap<String, String>(0);
}
// TODO validate entries
Map<String, String> rval = new HashMap<String, String>(props.size());
for (Entry<Object, Object> e : props.entrySet()) {
rval.put(e.getKey().toString(), e.getValue().toString());
}
return rval;
}
/**
* Return a map of values to keys.
*
* @param map
* @return
*/
private static Map<String, String> reverseMap(Map<String, String> map) {
Map<String, String> rval = new HashMap<String, String>(map.size());
for (Entry<String, String> e : map.entrySet()) {
rval.put(e.getValue(), e.getKey());
}
return rval;
}
/**
* @param id
* @return id if no mapping exists
*/
public static String internalToExternal(String id) {
String rval = internalToExternal.get(id);
if (rval == null) {
return id;
}
return rval;
}
/**
* @param id
* @return id if no mapping exists
*/
public static String externalToInternal(String id) {
String rval = externalToInternal.get(id);
if (rval == null) {
return id;
}
return rval;
}
}

View file

@ -1,44 +1,35 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.provider;
import static com.raytheon.uf.edex.wcs.provider.WcsJaxbUtils.getAsLangString;
import static com.raytheon.uf.edex.wcs.provider.WcsJaxbUtils.getKeywords;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.TimeZone;
import javax.xml.bind.JAXBElement;
@ -73,7 +64,6 @@ import org.jvnet.ogc.gml.v_3_1_1.jts.JTSToGML311SRSReferenceGroupConverter;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.ogc.common.db.LayerTransformer;
import com.raytheon.uf.edex.ogc.common.spatial.Composite3DBoundingBox;
import com.raytheon.uf.edex.ogc.common.spatial.CrsLookup;
import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate;
@ -193,9 +183,28 @@ public class DescCoverageBuilder {
return rval;
}
private static final ThreadLocal<SimpleDateFormat> ISO_FORMAT = new ThreadLocal<SimpleDateFormat>() {
/*
* (non-Javadoc)
*
* @see java.lang.ThreadLocal#initialValue()
*/
@Override
protected SimpleDateFormat initialValue() {
SimpleDateFormat rval = new SimpleDateFormat(
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
rval.setTimeZone(TimeZone.getTimeZone("GMT"));
return rval;
}
};
protected TimePositionType transform(Date time) {
TimePositionType rval = new TimePositionType();
String timeStr = LayerTransformer.format(time);
// client can't parse all ISO 8601, and it's our problem for some reason
// String timeStr = LayerTransformer.format(time);
String timeStr = ISO_FORMAT.get().format(time);
rval.setValue(Arrays.asList(timeStr));
return rval;
}
@ -212,6 +221,7 @@ public class DescCoverageBuilder {
TimeRange vp = time.getValidPeriod();
tp.setBeginPosition(transform(vp.getStart()));
tp.setEndPosition(transform(vp.getEnd()));
tp.setTimeResolution("PT0S");
rval.add(tp);
} else {
rval.add(transform(time.getRefTime()));

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
*
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.provider;
@ -71,12 +60,9 @@ import net.opengis.wcs.v_1_1_2.CoverageDescriptionType;
import net.opengis.wcs.v_1_1_2.CoverageDescriptions;
import net.opengis.wcs.v_1_1_2.CoveragesType;
import net.opengis.wcs.v_1_1_2.DescribeCoverage;
import net.opengis.wcs.v_1_1_2.DomainSubsetType;
import net.opengis.wcs.v_1_1_2.GetCapabilities;
import net.opengis.wcs.v_1_1_2.GetCoverage;
import net.opengis.wcs.v_1_1_2.GridCrsType;
import net.opengis.wcs.v_1_1_2.ObjectFactory;
import net.opengis.wcs.v_1_1_2.OutputType;
import net.opengis.wcs.v_1_1_2.RangeSubsetType;
import net.opengis.wcs.v_1_1_2.RangeSubsetType.FieldSubset;
import net.opengis.wcs.v_1_1_2.TimePeriodType;
@ -91,7 +77,6 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.ogc.common.OgcBoundingBox;
import com.raytheon.uf.edex.ogc.common.OgcException;
import com.raytheon.uf.edex.ogc.common.OgcNamespace;
import com.raytheon.uf.edex.ogc.common.OgcOperationInfo;
import com.raytheon.uf.edex.ogc.common.OgcPrefix;
@ -113,10 +98,10 @@ import com.raytheon.uf.edex.wcs.WcsProvider;
import com.raytheon.uf.edex.wcs.format.IWcsDataFormatter;
import com.raytheon.uf.edex.wcs.reg.Coverage;
import com.raytheon.uf.edex.wcs.reg.CoverageDescription;
import com.raytheon.uf.edex.wcs.reg.IWcsSource;
import com.raytheon.uf.edex.wcs.reg.RangeAxis;
import com.raytheon.uf.edex.wcs.reg.RangeField;
import com.raytheon.uf.edex.wcs.reg.RangeField.InterpolationType;
import com.raytheon.uf.edex.wcs.reg.IWcsSource;
import com.raytheon.uf.edex.wcs.reg.WcsSourceAccessor;
import com.raytheon.uf.edex.wcs.request.DescCoverageRequest;
import com.raytheon.uf.edex.wcs.request.GetCapRequest;
@ -245,26 +230,31 @@ public class OgcWcsProvider implements WcsProvider {
throws WcsException {
CoverageDescriptions rval = new CoverageDescriptions();
String[] ids = request.getIdentifiers();
String[] externalIds = request.getExternalIds();
List<CoverageDescriptionType> descs = null;
if (ids == null) {
if (externalIds == null) {
throw new WcsException(Code.MissingParameterValue);
}
descs = new ArrayList<CoverageDescriptionType>(ids.length);
for (String id : ids) {
descs.add(descCov(id));
String[] internalIds = request.getInternalIds();
descs = new ArrayList<CoverageDescriptionType>(externalIds.length);
for (int i = 0; i < externalIds.length; ++i) {
String external = externalIds[i];
String internal = internalIds[i];
descs.add(descCov(external, internal));
}
rval.setCoverageDescription(descs);
return rval;
}
protected CoverageDescriptionType descCov(String id) throws WcsException {
IWcsSource<?, ?> source = WcsSourceAccessor.getSource(id);
protected CoverageDescriptionType descCov(String externalId,
String internalId) throws WcsException {
IWcsSource<?, ?> source = WcsSourceAccessor.getSource(internalId);
if (source == null) {
throw new WcsException(Code.InvalidParameterValue,
"Coverage ID not found");
}
CoverageDescription cd = source.describeCoverage(id);
}
CoverageDescription cd = source.describeCoverage(internalId);
cd.setIdentifier(externalId);
return getCoverageBuilder().getCoverageDescriptionType(cd);
}
@ -276,10 +266,24 @@ public class OgcWcsProvider implements WcsProvider {
return marshalResponse(capabilities);
}
public Capabilities getCapabilities(EndpointInfo info,
GetCapabilities request) {
return getCapBuilder().getCapabilities(getServiceInfo(info),
WcsSourceAccessor.getCoverages(true));
public Capabilities getCapabilities(EndpointInfo info,
GetCapabilities request) {
return getCapBuilder().getCapabilities(getServiceInfo(info),
getCoverages(true));
}
/**
* @param summary
* @return list of coverages with mapped identifiers
*/
private List<CoverageDescription> getCoverages(boolean summary) {
List<CoverageDescription> coverages = WcsSourceAccessor
.getCoverages(true);
for (CoverageDescription desc : coverages) {
String id = CustomIdMap.internalToExternal(desc.getIdentifier());
desc.setIdentifier(id);
}
return coverages;
}
private OgcServiceInfo<WcsOpType> getServiceInfo(EndpointInfo info) {
@ -300,6 +304,7 @@ public class OgcWcsProvider implements WcsProvider {
protected OgcOperationInfo<WcsOpType> getOp(String get, String post,
WcsOpType type, EndpointInfo info) {
OgcOperationInfo<WcsOpType> rval = new OgcOperationInfo<WcsOpType>(type);
rval.setHttpBaseHostname(info.getHost());
if (!info.isPostOnly()) {
rval.setHttpGetRes(get);
}
@ -333,8 +338,9 @@ public class OgcWcsProvider implements WcsProvider {
}
}
String id = request.getIdentifier();
String externalId = request.getExternalId();
Coverage coverage = requestCoverage(request);
coverage.setName(CustomIdMap.internalToExternal(coverage.getName()));
CoveragesHolder holder = new CoveragesHolder();
holder.setContentType(format);
Map<String, byte[]> data = new HashMap<String, byte[]>();
@ -350,7 +356,7 @@ public class OgcWcsProvider implements WcsProvider {
throw new WcsException(Code.InternalServerError);
}
} else {
href = getCoverageId(id);
href = getCoverageId(externalId);
ByteArrayOutputStream out = new ByteArrayOutputStream();
InputStream in = null;
try {
@ -365,7 +371,7 @@ public class OgcWcsProvider implements WcsProvider {
}
data.put(href, out.toByteArray());
}
CoveragesType rval = getCoverageOgcResponse(id, href);
CoveragesType rval = getCoverageOgcResponse(externalId, href);
holder.setMetadata(rval);
holder.setData(data);
return holder;
@ -373,7 +379,7 @@ public class OgcWcsProvider implements WcsProvider {
private Coverage requestCoverage(GetCoverageRequest request)
throws WcsException {
String id = request.getIdentifier();
String id = request.getInternalId();
IWcsSource<?, ?> source = WcsSourceAccessor.getSource(id);
if (source == null) {
throw new WcsException(Code.InvalidParameterValue,
@ -404,19 +410,14 @@ public class OgcWcsProvider implements WcsProvider {
String format = request.getFormat();
IWcsDataFormatter formatter = WcsSourceAccessor.getFormatMap().get(
format);
if (formatter == null) {
throw new WcsException(Code.InvalidFormat);
}
String id = request.getIdentifier();
IWcsSource<?, ?> source = WcsSourceAccessor.getSource(id);
if (source == null) {
throw new WcsException(Code.LayerNotDefined);
}
Composite3DBoundingBox bbox = request.getBbox();
Coverage coverage = source.getCoverage(id,
request.getTimeSequence(), bbox, request.getFields());
CoveragesType coveragesType = getCoverageOgcResponse(id,
getCoverageId(id));
if (formatter == null) {
throw new WcsException(Code.InvalidFormat);
}
String externalId = request.getExternalId();
Coverage coverage = requestCoverage(request);
coverage.setName(CustomIdMap.internalToExternal(coverage.getName()));
CoveragesType coveragesType = getCoverageOgcResponse(externalId,
getCoverageId(externalId));
try {
// FIXME this code block makes my eyes bleed, needs to be
@ -439,7 +440,7 @@ public class OgcWcsProvider implements WcsProvider {
httpResp.setContentType("multipart/related;boundary=" + part);
PrintStream stream = new PrintStream(out);
String cid = getCoverageId(id);
String cid = getCoverageId(externalId);
stream.println("--" + part);
stream.println("Content-Type: text/xml");
@ -647,7 +648,7 @@ public class OgcWcsProvider implements WcsProvider {
DescribeCoverage req = (DescribeCoverage) obj;
List<String> ids = req.getIdentifier();
DescCoverageRequest dcr = new DescCoverageRequest();
dcr.setIdentifiers(ids.toArray(new String[ids.size()]));
dcr.setIdentifiers(ids);
rval = dcr;
} else {
rval = new WcsRequest(Type.ERROR);
@ -660,27 +661,13 @@ public class OgcWcsProvider implements WcsProvider {
* @return
*/
protected WcsRequest unwrap(GetCoverage req) {
GetCoverageRequest rval = new GetCoverageRequest();
DomainSubsetType ds = req.getDomainSubset();
rval.setTimeSequence(getTime(ds.getTemporalSubset()));
BoundingBoxType bbox = (BoundingBoxType) ds.getBoundingBox().getValue();
try {
rval.setBbox(bbox);
} catch (OgcException e) {
return new WcsRequest(Type.ERROR);
return new GetCoverageRequest(req);
} catch (WcsException e) {
WcsRequest rval = new WcsRequest(Type.ERROR);
rval.setRequest(e);
return rval;
}
rval.setIdentifier(req.getIdentifier().getValue());
OutputType output = req.getOutput();
rval.setFormat(output.getFormat());
GridCrsType gridCRS = output.getGridCRS();
if (gridCRS != null) {
rval.setGridBaseCrs(gridCRS.getGridBaseCRS());
rval.setGridOffsets(gridCRS.getGridOffsets());
rval.setGridOrigin(gridCRS.getGridOrigin());
rval.setGridType(gridCRS.getGridType());
}
rval.setFields(transform(req.getRangeSubset()));
return rval;
}
protected List<RangeField> transform(RangeSubsetType subset) {

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.provider;
import java.util.ArrayList;
@ -60,16 +49,12 @@ public class OperationsDescriber extends AbstractOpDescriber<WcsOpType> {
* .uf.edex.ogc.common.OgcServiceInfo)
*/
@Override
protected List<DomainType> getParams(OgcServiceInfo<WcsOpType> serviceinfo) {
List<DomainType> rval = new LinkedList<DomainType>();
// TODO: this info should be passed in from somewhere
DomainType parameter = new DomainType();
parameter.setName("srsName");
List<String> value = new LinkedList<String>();
value.add("EPSG:4326");
rval.add(parameter);
return rval;
}
protected List<DomainType> getParams(OgcServiceInfo<WcsOpType> serviceinfo) {
// TODO: this info should be passed in from somewhere
List<String> value = new LinkedList<String>();
value.add("EPSG:4326");
return Arrays.asList(getAsDomainType("srsName", value));
}
/*
* (non-Javadoc)

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.provider;
import java.util.ArrayList;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 5, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
import java.util.List;
@ -40,7 +29,7 @@ import java.util.List;
*/
public class Coverage {
private final String name;
private String name;
private final List<CoverageField> fields;
@ -68,5 +57,12 @@ public class Coverage {
return fields;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
import java.util.List;

View file

@ -1,41 +1,35 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 10, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.measure.unit.SI;
import org.apache.commons.lang.StringUtils;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@ -43,14 +37,19 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.DataTime.FLAG;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.edex.ogc.common.OgcGeoBoundingBox;
import com.raytheon.uf.edex.ogc.common.db.LayerTransformer;
import com.raytheon.uf.edex.ogc.common.db.SimpleDimension;
import com.raytheon.uf.edex.ogc.common.db.SimpleLayer;
import com.raytheon.uf.edex.ogc.common.spatial.AltUtil;
import com.raytheon.uf.edex.ogc.common.spatial.Composite3DBoundingBox;
import com.raytheon.uf.edex.ogc.common.spatial.CrsLookup;
import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate;
import com.raytheon.uf.edex.ogc.common.spatial.VerticalCoordinate.Reference;
import com.raytheon.uf.edex.plugin.dataset.urn.URNLookup;
import com.raytheon.uf.edex.wcs.WcsConfig;
import com.raytheon.uf.edex.wcs.WcsException;
import com.raytheon.uf.edex.wcs.WcsException.Code;
import com.vividsolutions.jts.geom.Coordinate;
@ -92,6 +91,22 @@ public abstract class CoverageTransform<D extends SimpleDimension, L extends Sim
rval.setIdentifier(URNLookup.localToUrn(layer.getName()));
OgcGeoBoundingBox bbox = LayerTransformer.getGeoBoundingBox(layer);
List<Composite3DBoundingBox> bboxes = getBboxes(layer);
if (!bboxes.isEmpty() && WcsConfig.isProperty(WcsConfig.FORCE_KM_BBOX)) {
List<Composite3DBoundingBox> newList = new ArrayList<Composite3DBoundingBox>(
bboxes.size());
for (Composite3DBoundingBox box : bboxes) {
if (box.hasVertical()) {
VerticalCoordinate vert = box.getVertical();
vert = AltUtil.convert(SI.KILOMETER, Reference.UNKNOWN,
vert);
newList.add(new Composite3DBoundingBox(box.getHorizontal(),
box.getNative2DCrsUrn(), vert));
} else {
newList.add(box);
}
}
bboxes = newList;
}
if (bbox != null) {
rval.setCrs84Bbox(bbox);
rval.setCrs(getSupportedCrsList(layer.getTargetCrsCode(), bboxes));
@ -130,7 +145,7 @@ public abstract class CoverageTransform<D extends SimpleDimension, L extends Sim
coords[4] = new Coordinate(minx, miny);
LinearRing ring = geomFact.createLinearRing(coords);
rval.setTimes(getTimes(layer.getTimes()));
rval.setTimes(getTimes(layer.getTimes(), layer.isTimesAsRanges()));
rval.setRangeFields(getRangeFields(layer));
rval.setPolygon(geomFact.createPolygon(ring, new LinearRing[0]));
rval.setGridType("urn:ogc:def:method:WCS:1.1:grid2dIn2dMethod");
@ -222,7 +237,7 @@ public abstract class CoverageTransform<D extends SimpleDimension, L extends Sim
return null;
}
if (crs.equalsIgnoreCase("crs:84")) {
return "urn:ogc:def:crs:OGC::CRS84";
return "urn:ogc:def:crs:OGC:2:84";
}
String[] split = crs.split(":");
List<String> parts = new ArrayList<String>(split.length + 1);
@ -243,14 +258,29 @@ public abstract class CoverageTransform<D extends SimpleDimension, L extends Sim
*/
protected abstract List<RangeField> getRangeFields(L layer);
protected List<DataTime> getTimes(Set<Date> times) {
if (times == null) {
return null;
}
List<DataTime> rval = new ArrayList<DataTime>(times.size());
for (Date d : times) {
rval.add(new DataTime(d));
protected List<DataTime> getTimes(Set<Date> times, boolean asRanges) {
if (times == null || times.isEmpty()) {
return new ArrayList<DataTime>(0);
}
List<DataTime> rval;
if (asRanges) {
rval = new ArrayList<DataTime>((int) Math.ceil(times.size() / 2.0));
Iterator<Date> iter = times.iterator();
while (iter.hasNext()) {
Date start = iter.next();
Date end = (iter.hasNext() ? iter.next() : start);
DataTime time = new DataTime(Calendar.getInstance(),
new TimeRange(start, end));
time.setUtilityFlags(EnumSet.of(FLAG.PERIOD_USED));
rval.add(time);
}
} else {
rval = new ArrayList<DataTime>(times.size());
for (Date d : times) {
rval.add(new DataTime(d));
}
}
return rval;
}
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 30, 2011 jelkins Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
import java.awt.Point;
@ -64,6 +53,7 @@ import org.hibernate.criterion.Conjunction;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.hibernate.criterion.SimpleExpression;
import org.opengis.geometry.DirectPosition;
import org.opengis.geometry.MismatchedDimensionException;
import org.opengis.metadata.spatial.PixelOrientation;
@ -137,6 +127,8 @@ public abstract class DefaultWcsSource<D extends SimpleDimension, L extends Simp
private static final String VALID_START = "dataTime.validPeriod.start";
private static final String VALID_END = "dataTime.validPeriod.end";
@SuppressWarnings("unchecked")
private final Map<String, ReferencedDataRecord> fillCache = Collections
.synchronizedMap(new LRUMap(2));
@ -852,12 +844,20 @@ public abstract class DefaultWcsSource<D extends SimpleDimension, L extends Simp
return null;
}
Criterion rval;
// any interacts
if (TemporalFilter.isRange(time)) {
TimeRange period = time.getValidPeriod();
rval = Restrictions.between(VALID_START, period.getStart(),
period.getEnd());
SimpleExpression lhs = Restrictions
.le(VALID_START, period.getEnd());
SimpleExpression rhs = Restrictions
.ge(VALID_END, period.getStart());
rval = Restrictions.and(lhs, rhs);
} else {
rval = Restrictions.eq(VALID_START, time.getRefTime());
SimpleExpression lhs = Restrictions.le(VALID_START,
time.getRefTime());
SimpleExpression rhs = Restrictions
.ge(VALID_END, time.getRefTime());
rval = Restrictions.and(lhs, rhs);
}
return rval;
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
import java.util.ArrayList;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
import java.util.ArrayList;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 10, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
/**

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 26, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
/**

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 5, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.reg;
import java.util.ArrayList;

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 29, 2011 jelkins Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.request;
import javax.servlet.http.HttpServletRequest;

View file

@ -1,35 +1,26 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 22, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.request;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import net.opengis.wcs.v_1_1_2.DescribeCoverage;
@ -38,7 +29,9 @@ public class DescCoverageRequest extends WcsRequest{
protected String outputformat = "text/xml; subtype=gml/3.1.1";
protected String[] identifiers;
protected String[] externalIds;
protected String[] internalIds;
public DescCoverageRequest() {
super(Type.DescribeCoverage);
@ -48,7 +41,9 @@ public class DescCoverageRequest extends WcsRequest{
super(Type.DescribeCoverage);
this.request = req;
List<String> ids = req.getIdentifier();
identifiers = ids.toArray(new String[ids.size()]);
this.externalIds = new String[ids.size()];
this.internalIds = new String[ids.size()];
setIdentifiers(req.getIdentifier());
}
public String getOutputformat() {
@ -59,12 +54,45 @@ public class DescCoverageRequest extends WcsRequest{
this.outputformat = outputformat;
}
public String[] getIdentifiers() {
return identifiers;
}
/**
* @return the externalIds
*/
public String[] getExternalIds() {
return externalIds;
}
public void setIdentifiers(String[] identifiers) {
this.identifiers = identifiers;
}
/**
* @param externalIds
* the externalIds to set
*/
public void setExternalIds(String[] externalIds) {
this.externalIds = externalIds;
}
/**
* @return the internalIds
*/
public String[] getInternalIds() {
return internalIds;
}
/**
* @param internalIds
* the internalIds to set
*/
public void setInternalIds(String[] internalIds) {
this.internalIds = internalIds;
}
/**
* @param array
*/
public void setIdentifiers(Collection<String> ids) {
Iterator<String> iter = ids.iterator();
for (int i = 0; iter.hasNext(); ++i) {
externalIds[i] = iter.next();
internalIds[i] = externalToInternal(externalIds[i]);
}
}
}

View file

@ -1,33 +1,22 @@
/*
* The following software products were developed by Raytheon:
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* ADE (AWIPS Development Environment) software
* CAVE (Common AWIPS Visualization Environment) software
* EDEX (Environmental Data Exchange) software
* uFrame (Universal Framework) software
* 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.
*
* Copyright (c) 2010 Raytheon Co.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/epl-v10.php
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* Contractor Name: Raytheon Company
* Contractor Address:
* 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 22, 2011 bclement Initial creation
*
*/
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.wcs.request;

Some files were not shown because too many files have changed in this diff Show more