Merge "Issue #1051 Discard bufrmos data with invalid location." into development
Former-commit-id:450af19c9c
[formerly 15e7809ca7503415ba0603cc39e7f0543d1e5af1] Former-commit-id:ff13fdaf20
This commit is contained in:
commit
a75ada03f9
2 changed files with 19 additions and 3 deletions
|
@ -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.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
* </pre>
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue