diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosDataLocation.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosDataLocation.java index 761e5d23e4..3a194075d5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosDataLocation.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosDataLocation.java @@ -47,7 +47,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 24, 2011 rjpeter Initial creation - * Jun 28, 2012 #827 dgilling Annotate id field for serialization. + * Jun 28, 2012 827 dgilling Annotate id field for serialization. + * Jul 26, 2013 1051 bsteffen Discard bufrmos data with invalid + * location. * * * @@ -132,6 +134,16 @@ public class BufrMosDataLocation extends PersistableDataObject { this.id = id; } + public boolean isValid() { + if (longitude == null || latitude == null) { + return false; + } + if (latitude > 90.0 || latitude < -90.0) { + return false; + } + return true; + } + @Override public int hashCode() { final int prime = 31; diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/decoder/BufrMOSDataAdapter.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/decoder/BufrMOSDataAdapter.java index dca20666c5..1cc6386a9c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/decoder/BufrMOSDataAdapter.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/decoder/BufrMOSDataAdapter.java @@ -60,6 +60,8 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Feb 21, 2008 862 jkorman Initial Coding. * May 09, 2013 1869 bsteffen Modified D2D time series of point data to * work without dataURI. + * Jul 26, 2013 1051 bsteffen Discard bufrmos data with invalid + * location. * * * @author jkorman @@ -192,8 +194,8 @@ public class BufrMOSDataAdapter { Calendar baseTime = null; // Ensure that we have all of the time info and create the // date-time and datatime info. - if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0) - && (fcstHour >= 0)) { + if (location.isValid() && (year > 0) && (month > 0) + && (day > 0) && (hour >= 0) && (fcstHour >= 0)) { baseTime = TimeTools.getBaseCalendar(year, month, day); baseTime.set(Calendar.HOUR_OF_DAY, hour); @@ -226,6 +228,8 @@ public class BufrMOSDataAdapter { } fcstData.setPointDataView(pdv); + } else { + fcstData = null; } dataSection += (System.currentTimeMillis() - startTime); }