CM-MERGE:OB13.5.6-4 into 14.1.3

Former-commit-id: 8ecdd9a192 [formerly 86dc406cd227362abc5274f4cd64813ceb91d00d]
Former-commit-id: 399c06820a
This commit is contained in:
Brian.Dyke 2014-06-18 08:55:49 -04:00
parent 06c565d74f
commit be589ceb9b
8 changed files with 115 additions and 36 deletions

View file

@ -100,6 +100,8 @@ import com.vividsolutions.jts.geom.LineString;
* 06-24-2013 DR 16317 D. Friedman Handle "motionless" track. * 06-24-2013 DR 16317 D. Friedman Handle "motionless" track.
* 04-07-2014 DR 17232 D. Friedman Make sure pivot indexes are valid. * 04-07-2014 DR 17232 D. Friedman Make sure pivot indexes are valid.
* 06-03-14 3191 njensen Fix postData to not retrieve * 06-03-14 3191 njensen Fix postData to not retrieve
* 06-17-2014 DR17409 mgamazaychikov Fix futurePoints calculation in generateNewTrackInfo()
* and generateExistingTrackInfo()
* *
* </pre> * </pre>
* *
@ -910,7 +912,7 @@ public class StormTrackDisplay implements IRenderable {
// time, the arrow of the pathcast is drawn behind the last frame // time, the arrow of the pathcast is drawn behind the last frame
if (state.duration >= 0) { if (state.duration >= 0) {
for (int i = 1; i < futurePoints.length - (remainder == 0 ? 0 : 1); ++i) { for (int i = 1; i < futurePoints.length - (remainder == 0 ? 0 : 1); ++i) {
timeInMillis += minIntervalInSeconds * 1000; timeInMillis += interval * 60 * 1000;
DataTime time = new DataTime(new Date(timeInMillis)); DataTime time = new DataTime(new Date(timeInMillis));
double distance = speed double distance = speed
@ -1062,7 +1064,7 @@ public class StormTrackDisplay implements IRenderable {
// time, the arrow of the pathcast is drawn behind the last frame // time, the arrow of the pathcast is drawn behind the last frame
if (state.duration >= 0) { if (state.duration >= 0) {
for (int i = 1; i < futurePoints.length - (remainder == 0 ? 0 : 1); ++i) { for (int i = 1; i < futurePoints.length - (remainder == 0 ? 0 : 1); ++i) {
timeInMillis += minIntervalInSeconds * 1000; timeInMillis += interval * 60 * 1000;
DataTime time = new DataTime(new Date(timeInMillis)); DataTime time = new DataTime(new Date(timeInMillis));
double distance = speed double distance = speed

View file

@ -21,6 +21,7 @@
package com.raytheon.viz.warngen.gis; package com.raytheon.viz.warngen.gis;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.EnumSet; import java.util.EnumSet;
@ -29,6 +30,7 @@ import java.util.List;
import org.geotools.referencing.GeodeticCalculator; import org.geotools.referencing.GeodeticCalculator;
import com.raytheon.uf.common.dataplugin.warning.util.CountyUserData;
import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.GeometryFactory;
@ -53,6 +55,8 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* 0.10 to 0.0625 for EXTREME_DELTA; Added/modified code. * 0.10 to 0.0625 for EXTREME_DELTA; Added/modified code.
* May 1, 2013 1963 jsanchez Refactored calculatePortion to match A1. Do not allow 'Central' to be included if East and West is included. * May 1, 2013 1963 jsanchez Refactored calculatePortion to match A1. Do not allow 'Central' to be included if East and West is included.
* Jun 3, 2013 2029 jsanchez Updated A1 special case for calculating a central portion. Allowed East Central and West Central. * Jun 3, 2013 2029 jsanchez Updated A1 special case for calculating a central portion. Allowed East Central and West Central.
* Jun 17, 2014 DR 17390 Qinglu Lin Update calculateLocationPortion(). Use centroid in maps county table for geomCentroid
* for county based products.
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -344,13 +348,22 @@ public class GisUtil {
* @return * @return
*/ */
public static EnumSet<Direction> calculateLocationPortion( public static EnumSet<Direction> calculateLocationPortion(
Geometry locationGeom, Geometry reference, boolean useExtreme) { Geometry locationGeom, Geometry reference, boolean useExtreme, boolean notUseShapefileCentroid) {
for (int i = 0; i < locationGeom.getNumGeometries(); i++) { for (int i = 0; i < locationGeom.getNumGeometries(); i++) {
Geometry geom = locationGeom.getGeometryN(i); Geometry geom = locationGeom.getGeometryN(i);
if (geom.intersects(reference)) { if (geom.intersects(reference)) {
Coordinate geomCentroid = geom.getEnvelope().getCentroid() Coordinate geomCentroid = null;
if (notUseShapefileCentroid) {
geomCentroid = geom.getEnvelope().getCentroid()
.getCoordinate(); .getCoordinate();
} else {
geomCentroid = new Coordinate();
geomCentroid.x = ((BigDecimal)((CountyUserData)geom.getUserData()).
entry.attributes.get("LON")).doubleValue();
geomCentroid.y = ((BigDecimal)((CountyUserData)geom.getUserData()).
entry.attributes.get("LAT")).doubleValue();
}
Coordinate refCentroid = reference.getCentroid() Coordinate refCentroid = reference.getCentroid()
.getCoordinate(); .getCoordinate();

View file

@ -23,6 +23,7 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.raytheon.uf.common.dataplugin.warning.util.CountyUserData;
import com.raytheon.viz.warngen.gis.GisUtil.Direction; import com.raytheon.viz.warngen.gis.GisUtil.Direction;
import com.raytheon.viz.warngen.gui.WarngenLayer; import com.raytheon.viz.warngen.gui.WarngenLayer;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
@ -39,6 +40,7 @@ import com.vividsolutions.jts.geom.Geometry;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 5, 2013 2177 jsanchez Initial creation * Aug 5, 2013 2177 jsanchez Initial creation
* Sep 22, 2013 2177 jsanchez Updated logic. Used GisUtil for very small portions. * Sep 22, 2013 2177 jsanchez Updated logic. Used GisUtil for very small portions.
* Jun 17, 2014 DR 17390 Qinglu Lin Update getPortions().
* *
* </pre> * </pre>
* *
@ -78,8 +80,15 @@ public class PortionsUtil {
// This takes into account the warned areas that are very small // This takes into account the warned areas that are very small
// the convex hull of the warned area is used for case the // the convex hull of the warned area is used for case the
// warnedArea is a geometry collection. // warnedArea is a geometry collection.
CountyUserData cud = (CountyUserData) countyOrZone.getUserData();
String countyName = (String) cud.entry.attributes.get("COUNTYNAME");
if (countyName == null) {
portions = GisUtil.calculateLocationPortion(countyOrZone, portions = GisUtil.calculateLocationPortion(countyOrZone,
warnedArea.convexHull(), useExtreme); warnedArea.convexHull(), useExtreme, true);
} else {
portions = GisUtil.calculateLocationPortion(countyOrZone,
warnedArea.convexHull(), useExtreme, false);
}
} else { } else {
portions = getAreaDesc(entityData.getMeanMask(), portions = getAreaDesc(entityData.getMeanMask(),
entityData.getCoverageMask(), entityData.getOctants(), entityData.getCoverageMask(), entityData.getOctants(),

View file

@ -115,6 +115,7 @@ import com.vividsolutions.jts.geom.Point;
* Jun 24, 2013 DR 16317 D. Friedman Handle "motionless" track. * Jun 24, 2013 DR 16317 D. Friedman Handle "motionless" track.
* Jun 25, 2013 16224 Qinglu Lin Resolved the issue with "Date start" for pathcast in CON. * Jun 25, 2013 16224 Qinglu Lin Resolved the issue with "Date start" for pathcast in CON.
* Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization. * Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization.
* Jun 17, 2014 DR 17390 Qinglu Lin Updated getClosestPoints().
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -766,7 +767,7 @@ public class Wx {
cp.partOfArea = GisUtil.asStringList(GisUtil cp.partOfArea = GisUtil.asStringList(GisUtil
.calculateLocationPortion( .calculateLocationPortion(
cp.prepGeom.getGeometry(), reference, cp.prepGeom.getGeometry(), reference,
false)); false, true));
distance = 0; distance = 0;
} }
} }

View file

@ -63,6 +63,7 @@ import com.raytheon.uf.edex.core.EdexException;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* ??? ??, 20?? wldougher Initial creation * ??? ??, 20?? wldougher Initial creation
* Jun 09, 2014 #3268 dgilling Ensure code works in multi-domain scenarios. * Jun 09, 2014 #3268 dgilling Ensure code works in multi-domain scenarios.
* Jun 13, 2014 #3278 dgilling Ensure temporary files get deleted.
* *
* </pre> * </pre>
* *
@ -152,7 +153,13 @@ public class WCLWatchSrv {
// Move the file to the wcl folder // Move the file to the wcl folder
// Rename it to <wclDir>/<completeProductPil> // Rename it to <wclDir>/<completeProductPil>
statusHandler.info("Placing WCL Procedure Utility in ifpServer "); statusHandler.info("Placing WCL Procedure Utility in ifpServer ");
try {
makePermanent(tmpFile, completeProductPil, siteIDs); makePermanent(tmpFile, completeProductPil, siteIDs);
} finally {
if (tmpFile != null) {
tmpFile.delete();
}
}
if (doNotify && wclInfo.getNotify()) { if (doNotify && wclInfo.getNotify()) {
for (String siteID : sitesToNotify) { for (String siteID : sitesToNotify) {
@ -166,40 +173,22 @@ public class WCLWatchSrv {
} }
statusHandler.debug("handleWclWatch() ending"); statusHandler.debug("handleWclWatch() ending");
return;
} }
/** /**
* Convert a temporary parsed WCL file to a permanent one by moving it to * Convert a temporary parsed WCL file to a permanent one by copying its
* the WCL directory. This is done through File.renameTo(). Unfortunately, * contents to the localization path cave_static.SITE/gfe/wcl/ for each of
* that method returns a boolean success flag rather than throwing an error, * the specified sites.
* so all we can do is tell the user that the rename failed, not why.
*
* @param wclData
* WCL data to write to file.
* @param completeProductPil
* The simple name of the file.
*
* @throws EdexException
* if WCL file cannot be opened, written, or closed.
*/
/**
* Convert a temporary parsed WCL file to a permanent one by moving it to
* the WCL directory. This is done through File.renameTo(). Unfortunately,
* that method returns a boolean success flag rather than throwing an error,
* so all we can do is tell the user that the rename failed, not why.
* *
* @param tmpFile * @param tmpFile
* The temporary file (may be null) * The temporary file (may be {@code null})
* @param completeProductPil * @param completeProductPil
* The simple name of the file. * The base name of the files to write.
* @param siteIDs * @param siteIDs
* The set of siteIDs to write out the WCL data for. * The set of siteIDs to write out the WCL data for.
* @throws EdexException
* if tmpFile cannot be renamed.
*/ */
protected void makePermanent(File tmpFile, String completeProductPil, protected void makePermanent(File tmpFile, String completeProductPil,
Collection<String> siteIDs) throws EdexException { Collection<String> siteIDs) {
statusHandler.debug("makePermanent(" + tmpFile + "," statusHandler.debug("makePermanent(" + tmpFile + ","
+ completeProductPil + ") started"); + completeProductPil + ") started");
if (tmpFile != null) { if (tmpFile != null) {
@ -243,7 +232,7 @@ public class WCLWatchSrv {
File tmpFile = null; File tmpFile = null;
PrintStream wclOut = null; PrintStream wclOut = null;
try { try {
tmpFile = File.createTempFile("wcl", null, null); tmpFile = File.createTempFile("wcl", null);
wclOut = new PrintStream(tmpFile); wclOut = new PrintStream(tmpFile);
wclOut.println(wclStr); wclOut.println(wclStr);
} catch (IOException e) { } catch (IOException e) {

View file

@ -60,6 +60,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* So, do not add the returned value of getFeAreaField() * So, do not add the returned value of getFeAreaField()
* to areaFields. * to areaFields.
* Jan 9, 2013 15600 Qinglu Lin Execute "timezones = myTimeZones;" even if timezones != null. * Jan 9, 2013 15600 Qinglu Lin Execute "timezones = myTimeZones;" even if timezones != null.
* Jun 17, 2014 DR 17390 Qinglu Lin Updated getMetaDataMap() for lonField and latField.
* *
* </pre> * </pre>
* *
@ -211,6 +212,9 @@ public class GeospatialFactory {
areaFields.add(feAreaField); areaFields.add(feAreaField);
} }
areaFields.add("LON");
areaFields.add("LAT");
if (timeZoneField != null) { if (timeZoneField != null) {
areaFields.add(timeZoneField); areaFields.add(timeZoneField);
} }

View file

@ -1,4 +1,34 @@
#!/bin/bash #!/bin/bash
##
# 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.
##
##############################################################################
# Process Received Digital Grids
# This is run at the backup site to merge the failed site's grids into the
# Fcst database.
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 06/16/15 3276 randerso Added -T to iscMosaic call
##############################################################################
import_file=${1} import_file=${1}
log_msg Processing file: $import_file log_msg Processing file: $import_file
@ -98,7 +128,7 @@ log_msg "CDSPORT is $CDSPORT"
log_msg Beginning iscMosaic log_msg Beginning iscMosaic
log_msg 75 log_msg 75
${GFESUITE_BIN}/iscMosaic -h $SVCBU_HOST -r $CDSPORT -d ${SITE}_GRID__Fcst_00000000_0000 -f ${SVCBU_HOME}/${failed_site}Grd.netcdf.gz -n ${GFESUITE_BIN}/iscMosaic -h $SVCBU_HOST -r $CDSPORT -d ${SITE}_GRID__Fcst_00000000_0000 -f ${SVCBU_HOME}/${failed_site}Grd.netcdf.gz -n -T
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
log_msg "ERROR: iscMosaic failed to import grids from ${SITE}_GRID__Fcst_00000000_0000" log_msg "ERROR: iscMosaic failed to import grids from ${SITE}_GRID__Fcst_00000000_0000"

View file

@ -1,4 +1,35 @@
#!/bin/bash #!/bin/bash
##
# 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.
##
##############################################################################
# Receive grids from backup site
# This script is run when importing your digital data back from the backup site.
# The grids are placed in the Restore database.
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 06/16/15 3276 randerso Added -T to iscMosaic call
##############################################################################
if [ ${#AWIPS_HOME} = 0 ] if [ ${#AWIPS_HOME} = 0 ]
then then
path_to_script=`readlink -f $0` path_to_script=`readlink -f $0`
@ -94,7 +125,7 @@ if [ -a ${import_file} ]
then then
#use iscMosaic to load grids into databases #use iscMosaic to load grids into databases
log_msg "Running iscMosaic to unpack griddded data..." log_msg "Running iscMosaic to unpack griddded data..."
${GFESUITE_BIN}/iscMosaic -h $SVCBU_HOST -r $CDSPORT -d ${SITE}_GRID__Restore_00000000_0000 -f ${import_file} -n -x ${GFESUITE_BIN}/iscMosaic -h $SVCBU_HOST -r $CDSPORT -d ${SITE}_GRID__Restore_00000000_0000 -f ${import_file} -n -T -x
if [ $? -ne 0 ]; if [ $? -ne 0 ];
then then
log_msg "ERROR: iscMosaic failed to run correctly. Please re-run iscMosaic manually." log_msg "ERROR: iscMosaic failed to run correctly. Please re-run iscMosaic manually."