From d395fc27fc163b2f1f124017e47c57f63e8859d1 Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Tue, 22 Jul 2014 12:28:27 -0500 Subject: [PATCH] Omaha #3410 changed lon/lat fields to floats in sfc and air obs location Change-Id: I4c8d47b9f9e598e69309f1aa99bc30c022cae7af Former-commit-id: 26ade7cae88d84ef9e1aed95b3df2cd6d5f893ee [formerly a7d17bd490f2f0931f3c22ee5484214041a34bd6] [formerly aa991c922354f0a67fac08fee456ca60a30de968] [formerly 74a6c3dd20898e9bd4484376ea4e4e471bdec9af [formerly aa991c922354f0a67fac08fee456ca60a30de968 [formerly cdb0a72fcb2345564f2b944fdecd7869fd498767]]] Former-commit-id: 74a6c3dd20898e9bd4484376ea4e4e471bdec9af Former-commit-id: 53a85ec6b9da7b5e37777469d995ba034e153ce6 [formerly 10ea02b9366284a7b97f57ffdb7ac54688cfa0c4] Former-commit-id: 5977b049c1eda298ce206a8d5fc34b8f235639c5 --- .../AcarsSndNSharpResourceData.java | 7 +-- .../nsharp/rsc/BufruaNSharpResourceData.java | 7 +-- .../d2d/nsharp/rsc/D2DNSharpResourceData.java | 22 ++++++++ .../nsharp/rsc/GoesSndNSharpResourceData.java | 7 +-- .../nsharp/rsc/MdlSndNSharpResourceData.java | 15 +++-- .../nsharp/rsc/PoesSndNSharpResourceData.java | 7 +-- .../provider/NucapsSoundingProvider.java | 5 +- .../providers/GridSoundingProvider.java | 7 ++- .../ui/popupskewt/rsc/PopupSkewTResource.java | 5 +- .../viz/pointdata/PlotAlertParser.java | 7 ++- .../retrieve/PointDataPlotInfoRetriever.java | 5 +- .../datacatalog/ModelSoundingCatalog.java | 5 +- .../datacatalog/PointDataCatalog.java | 9 +-- .../14.4.1/DR3410/lonLatDoubleToReal.sh | 32 +++++++++++ .../edex/plugin/bufrua/BufrUADecoder.java | 15 ++--- .../decoder/GOESSoundingDataAdapter.java | 4 +- .../plugin/ldadhydro/dao/HydroDecoder.java | 15 ++--- .../plugin/ldadmanual/dao/ManualDecoder.java | 9 +-- .../ldadmanual/dao/ManualLdadRecord.java | 5 +- .../edex/plugin/obs/metar/MetarDecoder.java | 6 +- .../obs/metar/MetarPointDataTransform.java | 5 +- .../decoder/POESSoundingDataAdapter.java | 4 +- .../profiler/decoder/ProfilerDataAdapter.java | 3 +- .../decoder/buoy/DRIBUSynopticDecoder.java | 25 +++++---- .../synoptic/MobileSynopticDecoder.java | 13 +++-- .../decoder/synoptic/SHIPSynopticDecoder.java | 17 +++--- .../acarssounding/tools/Airport.java | 13 +++-- .../bufrua/dao/BufrUAPointDataTransform.java | 10 ++-- .../fssobs/FSSObsRecordTransform.java | 12 ++-- .../LdadmesonetPointDataTransform.java | 5 +- .../ModelSoundingPointDataTransform.java | 5 +- .../dataplugin/obs/metar/MetarRecord.java | 5 +- .../profiler/dao/ProfilerDataTransform.java | 5 +- .../tcs/TropicalCycloneSummary.java | 5 +- .../uf/common/dataplugin/tcs/util/Util.java | 19 ++++--- .../uf/common/sounding/VerticalSounding.java | 5 +- .../filterimpl/PluginDataObjectFilter.java | 23 ++++---- .../edex/ogc/common/feature/ObsLocation.java | 5 +- .../acars/decoder/ACARSDataAdapter.java | 17 +++--- .../bufrascat/decoder/AScatDataAdapter.java | 3 +- .../bufrhdw/decoder/HDWDataAdapter.java | 5 +- .../bufrmthdw/decoder/MTHDWDataAdapter.java | 5 +- .../bufrncwf/decoder/BUFRncwfDataAdapter.java | 21 ++++--- .../bufrobs/AbstractBufrSfcObsDecoder.java | 5 +- .../plugin/bufrobs/buoy/BuoyBufrDecoder.java | 3 +- .../decoder/QUIKScatDataAdapter.java | 3 +- .../bufrssmi/decoder/SSMIDataAdapter.java | 3 +- .../plugin/fssobs/FSSObsDataTransform.java | 27 ++++----- .../plugin/ldadmesonet/MesonetDecoder.java | 9 +-- .../uf/edex/plugin/lsr/decoder/LSRParser.java | 5 +- .../decoder/ModelSoundingDataAdapter.java | 3 +- .../raytheon/uf/edex/plugin/qc/QCScanner.java | 5 +- .../plugin/svrwx/decoder/SvrWxParser.java | 33 +++++------ .../uf/edex/plugin/tcg/decoder/HURData.java | 15 ++--- .../uf/edex/plugin/tcg/decoder/QLMData.java | 15 ++--- .../uf/edex/plugin/tcg/decoder/TCEData.java | 15 ++--- .../uf/edex/plugin/tcs/decoder/TCMData.java | 5 +- .../uf/edex/plugin/vaa/decoder/VAAParser.java | 14 ++--- .../dataplugin/ncpafm/NcPafmBulletin.java | 14 ++--- .../ncscd/dao/NcScdPointDataTransform.java | 11 ++-- .../dataplugin/nctaf/dao/NcTafToRecord.java | 29 +++++----- .../dataplugin/ncuair/dao/NcUairToRecord.java | 28 +++++----- .../ncep/edex/plugin/airep/AirepDecoder.java | 5 +- .../edex/plugin/ncscd/util/NcScdParser.java | 17 +++--- .../plugin/nctaf/decoder/NcTafParser.java | 14 ++--- .../plugin/ncuair/decoder/NcUairDecoder.java | 56 ++++++++----------- .../ncep/edex/plugin/pirep/PirepDecoder.java | 5 +- .../plugin/pirep/decoder/PirepParser.java | 12 ++-- .../plotdata/rsc/TafPlotInfoRetriever.java | 5 +- 69 files changed, 426 insertions(+), 354 deletions(-) create mode 100755 deltaScripts/14.4.1/DR3410/lonLatDoubleToReal.sh diff --git a/cave/com.raytheon.uf.viz.acarssounding/src/com/raytheon/uf/viz/acarssounding/AcarsSndNSharpResourceData.java b/cave/com.raytheon.uf.viz.acarssounding/src/com/raytheon/uf/viz/acarssounding/AcarsSndNSharpResourceData.java index a9df4bf982..30c297da4b 100644 --- a/cave/com.raytheon.uf.viz.acarssounding/src/com/raytheon/uf/viz/acarssounding/AcarsSndNSharpResourceData.java +++ b/cave/com.raytheon.uf.viz.acarssounding/src/com/raytheon/uf/viz/acarssounding/AcarsSndNSharpResourceData.java @@ -51,7 +51,6 @@ import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.d2d.nsharp.SoundingLayerBuilder; import com.raytheon.uf.viz.d2d.nsharp.rsc.D2DNSharpResourceData; -import com.vividsolutions.jts.geom.Coordinate; /** * Provides sounding data to nsharp from aircraft reports. @@ -63,6 +62,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 15, 2013 bsteffen Initial creation + * Jul 23, 2014 3410 bclement preparePointInfo() calls unpackResultLocation() * * * @@ -94,9 +94,8 @@ public class AcarsSndNSharpResourceData extends D2DNSharpResourceData { for (Map result : response.getResults()) { if (coordinate == null) { - coordinate = new Coordinate(); - coordinate.x = (Double) result.get(LONGITUDE); - coordinate.y = (Double) result.get(LATITUDE); + coordinate = unpackResultLocation(result, LONGITUDE, + LATITUDE); } } } diff --git a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/BufruaNSharpResourceData.java b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/BufruaNSharpResourceData.java index 01521dc599..40f04cb3fb 100644 --- a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/BufruaNSharpResourceData.java +++ b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/BufruaNSharpResourceData.java @@ -34,7 +34,6 @@ import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; -import com.vividsolutions.jts.geom.Coordinate; /** * @@ -47,6 +46,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jul 26, 2011 bsteffen Initial creation + * Jul 23, 2014 3410 bclement preparePointInfo() calls unpackResultLocation() * * * @@ -81,9 +81,8 @@ public class BufruaNSharpResourceData extends D2DNSharpResourceData { pointName = (String) result.get(STATION_NAME); } if (coordinate == null) { - coordinate = new Coordinate(); - coordinate.x = (Double) result.get(LONGITUDE); - coordinate.y = (Double) result.get(LATITUDE); + coordinate = unpackResultLocation(result, LONGITUDE, + LATITUDE); } } } diff --git a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpResourceData.java b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpResourceData.java index 5d9e3e5c52..e2503ef6b6 100644 --- a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpResourceData.java +++ b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpResourceData.java @@ -31,6 +31,7 @@ import java.util.Arrays; import java.util.Calendar; import java.util.Comparator; import java.util.List; +import java.util.Map; import java.util.TimeZone; import javax.xml.bind.annotation.XmlAccessType; @@ -39,6 +40,7 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import com.raytheon.uf.common.dataplugin.PluginDataObject; +import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime.FLAG; import com.raytheon.uf.viz.core.alerts.DataCubeAlertMessageParser; @@ -62,6 +64,7 @@ import com.vividsolutions.jts.geom.Coordinate; * May 31, 2013 1847 bsteffen D2D nsharp will now format Lat/Lons as * stationId like NC ncharp. * May 08, 2014 2060 njensen Constructor sets alert parser + * Jul 23, 2014 3410 bclement added unpackResultLocation() * * * @@ -148,6 +151,25 @@ public abstract class D2DNSharpResourceData extends protected abstract void preparePointInfo() throws VizException; + /** + * Creates a new coordinate from query result map + * + * @see DbQueryResponse#getResults() + * @param result + * @param lonKey + * longitude field + * @param latKey + * latitude field + * @return + */ + protected static Coordinate unpackResultLocation( + Map result, String lonKey, String latKey) { + Coordinate rval = new Coordinate(); + rval.x = ((Number) result.get(lonKey)).doubleValue(); + rval.y = ((Number) result.get(latKey)).doubleValue(); + return rval; + } + protected abstract NcSoundingCube getSoundingCube(NsharpStationInfo stnInfo); protected void populateDataObject(D2DNSharpDataObject dataObject) { diff --git a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/GoesSndNSharpResourceData.java b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/GoesSndNSharpResourceData.java index e4a049fac3..4835946e17 100644 --- a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/GoesSndNSharpResourceData.java +++ b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/GoesSndNSharpResourceData.java @@ -49,7 +49,6 @@ import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.d2d.nsharp.SoundingLayerBuilder; import com.raytheon.viz.pointdata.PointDataRequest; -import com.vividsolutions.jts.geom.Coordinate; /** * Provides sounding data to nsharp from goes sounding satellite data. @@ -61,6 +60,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 14, 2013 2259 bsteffen Initial creation + * Jul 23, 2014 3410 bclement preparePointInfo() calls unpackResultLocation() * * * @@ -105,9 +105,8 @@ public class GoesSndNSharpResourceData extends D2DNSharpResourceData { for (Map result : response.getResults()) { if (coordinate == null) { - coordinate = new Coordinate(); - coordinate.x = (Double) result.get(LONGITUDE); - coordinate.y = (Double) result.get(LATITUDE); + coordinate = unpackResultLocation(result, LONGITUDE, + LATITUDE); } } } diff --git a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/MdlSndNSharpResourceData.java b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/MdlSndNSharpResourceData.java index cdd2e00832..baf9b00083 100644 --- a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/MdlSndNSharpResourceData.java +++ b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/MdlSndNSharpResourceData.java @@ -33,22 +33,22 @@ import com.raytheon.uf.common.dataquery.requests.DbQueryRequest; import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; -import com.vividsolutions.jts.geom.Coordinate; /** * * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jul 26, 2011            bsteffen     Initial creation
- *
+ * Jul 23, 2014 3410       bclement     preparePointInfo() calls unpackResultLocation()
+ * 
  * 
- * + * * @author bsteffen * @version 1.0 */ @@ -84,9 +84,8 @@ public class MdlSndNSharpResourceData extends D2DNSharpResourceData { pointName = (String) result.get(STATION_NAME); } if (coordinate == null) { - coordinate = new Coordinate(); - coordinate.x = (Double) result.get(LONGITUDE); - coordinate.y = (Double) result.get(LATITUDE); + coordinate = unpackResultLocation(result, LONGITUDE, + LATITUDE); } } } diff --git a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/PoesSndNSharpResourceData.java b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/PoesSndNSharpResourceData.java index 073bdd3ed6..796c47adee 100644 --- a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/PoesSndNSharpResourceData.java +++ b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/PoesSndNSharpResourceData.java @@ -49,7 +49,6 @@ import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.d2d.nsharp.SoundingLayerBuilder; import com.raytheon.viz.pointdata.PointDataRequest; -import com.vividsolutions.jts.geom.Coordinate; /** * Provides sounding data to nsharp from poes sounding satellite data. @@ -61,6 +60,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 14, 2013 2260 bsteffen Initial creation + * Jul 23, 2014 3410 bclement preparePointInfo() calls unpackResultLocation() * * * @@ -104,9 +104,8 @@ public class PoesSndNSharpResourceData extends D2DNSharpResourceData { for (Map result : response.getResults()) { if (coordinate == null) { - coordinate = new Coordinate(); - coordinate.x = (Double) result.get(LONGITUDE); - coordinate.y = (Double) result.get(LATITUDE); + coordinate = unpackResultLocation(result, LONGITUDE, + LATITUDE); } } } diff --git a/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/provider/NucapsSoundingProvider.java b/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/provider/NucapsSoundingProvider.java index e38e321d07..369ff483fe 100644 --- a/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/provider/NucapsSoundingProvider.java +++ b/cave/com.raytheon.uf.viz.npp.nucaps/src/com/raytheon/uf/viz/npp/nucaps/provider/NucapsSoundingProvider.java @@ -65,6 +65,7 @@ import com.vividsolutions.jts.index.strtree.STRtree; * Jul 25, 2013 2190 mschenke Initial creation * Aug 15, 2013 2260 bsteffen Switch poessounding to NSharp. * Aug 27, 2013 2190 mschenke Fixed point query request + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -114,8 +115,8 @@ public class NucapsSoundingProvider extends sounding.setStationId(NucapsRecord.PLUGIN_NAME); Coordinate location = getSoundingLocation(); sounding.setName(GeoUtil.formatCoordinate(location)); - sounding.setLongitude(location.x); - sounding.setLongitude(location.y); + sounding.setLongitude((float) location.x); + sounding.setLongitude((float) location.y); // Get pressure values Number[] pressures = pdv diff --git a/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/providers/GridSoundingProvider.java b/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/providers/GridSoundingProvider.java index 7b55f14a4e..b8849d41cd 100644 --- a/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/providers/GridSoundingProvider.java +++ b/cave/com.raytheon.uf.viz.sounding/src/com/raytheon/uf/viz/sounding/providers/GridSoundingProvider.java @@ -29,7 +29,6 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; -import com.raytheon.uf.common.inventory.exception.DataCubeException; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridRecord; @@ -42,6 +41,7 @@ import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.geospatial.ISpatialObject; import com.raytheon.uf.common.geospatial.MapUtil; import com.raytheon.uf.common.geospatial.PointUtil; +import com.raytheon.uf.common.inventory.exception.DataCubeException; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.sounding.SoundingLayer; import com.raytheon.uf.common.sounding.VerticalSounding; @@ -62,6 +62,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jul 22, 2013 2190 mschenke Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -239,8 +240,8 @@ public class GridSoundingProvider extends vs = createSounding(index, records); SurfaceObsLocation loc = new SurfaceObsLocation(); loc.setStationId(vs.getStationId()); - loc.setLatitude(location.y); - loc.setLongitude(location.x); + loc.setLatitude((float) location.y); + loc.setLongitude((float) location.x); vs.setSpatialInfo(loc); vs.setName(GeoUtil.formatCoordinate(location)); sounding[index] = vs; diff --git a/cave/com.raytheon.uf.viz.ui.popupskewt/src/com/raytheon/uf/viz/ui/popupskewt/rsc/PopupSkewTResource.java b/cave/com.raytheon.uf.viz.ui.popupskewt/src/com/raytheon/uf/viz/ui/popupskewt/rsc/PopupSkewTResource.java index 44f1512031..54279aaad1 100644 --- a/cave/com.raytheon.uf.viz.ui.popupskewt/src/com/raytheon/uf/viz/ui/popupskewt/rsc/PopupSkewTResource.java +++ b/cave/com.raytheon.uf.viz.ui.popupskewt/src/com/raytheon/uf/viz/ui/popupskewt/rsc/PopupSkewTResource.java @@ -59,6 +59,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jul 19, 2013 2190 mschenke Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -357,8 +358,8 @@ public class PopupSkewTResource extends } } } - sounding.setLongitude(location.x); - sounding.setLatitude(location.y); + sounding.setLongitude((float) location.x); + sounding.setLatitude((float) location.y); sounding.setDataTime(requestTime); this.sounding = sounding; } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java index e155670c48..adda90b106 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/PlotAlertParser.java @@ -37,6 +37,7 @@ import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Sep 15, 2009 mschenke Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -51,8 +52,10 @@ public class PlotAlertParser extends AbstractAlertMessageParser { AbstractRequestableResourceData resourceData) throws VizException { String stationId = (String) message.decodedAlert .get("location.stationId"); - Double lat = (Double) message.decodedAlert.get("location.latitude"); - Double lon = (Double) message.decodedAlert.get("location.longitude"); + Double lat = ((Number) message.decodedAlert.get("location.latitude")) + .doubleValue(); + Double lon = ((Number) message.decodedAlert.get("location.longitude")) + .doubleValue(); DataTime dataTime = (DataTime) message.decodedAlert.get("dataTime"); return new PlotInfo(stationId, lat, lon, dataTime, message.dataURI); diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java index f54224d14d..d9ddf4c8d5 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java @@ -50,6 +50,7 @@ import com.raytheon.viz.pointdata.rsc.PlotResourceData; * ------------ ---------- ----------- -------------------------- * Oct 09, 2009 bsteffen Initial creation * May 14, 2013 1869 bsteffen Get plots working without dataURI + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -87,8 +88,8 @@ public class PointDataPlotInfoRetriever extends AbstractDbPlotInfoRetriever { @Override protected PlotInfo getPlotInfo(Object[] data) { PlotInfo stationInfo = new PlotInfo(); - stationInfo.latitude = (Double) data[0]; - stationInfo.longitude = (Double) data[1]; + stationInfo.latitude = ((Number) data[0]).doubleValue(); + stationInfo.longitude = ((Number) data[1]).doubleValue(); stationInfo.stationId = (String) data[2]; if (stationInfo.stationId == null) { stationInfo.stationId = "" + stationInfo.latitude + "#" diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/ModelSoundingCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/ModelSoundingCatalog.java index e6ab15fbba..31064d9c7e 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/ModelSoundingCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/ModelSoundingCatalog.java @@ -53,6 +53,7 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList; * Sep 28, 2011 mschenke Initial creation * May 02, 2013 1949 bsteffen Force ModelSounding in Vb to play nicely * with others. + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -249,8 +250,8 @@ public class ModelSoundingCatalog extends PointDataCatalog { for (Entry entry : spipv.getSpiList().entrySet()) { SurfaceObsLocation loc = new SurfaceObsLocation(); loc.setStationId(entry.getKey()); - loc.setLatitude(entry.getValue().latlon.y); - loc.setLongitude(entry.getValue().latlon.x); + loc.setLatitude((float) entry.getValue().latlon.y); + loc.setLongitude((float) entry.getValue().latlon.x); locs.add(loc); } Collections.sort(locs, locComparator); diff --git a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java index ae03124785..35687e2f1b 100644 --- a/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java +++ b/cave/com.raytheon.viz.volumebrowser/src/com/raytheon/viz/volumebrowser/datacatalog/PointDataCatalog.java @@ -79,6 +79,7 @@ import com.vividsolutions.jts.geom.LineString; * Aug 15, 2013 2258 bsteffen Convert profiler sounding to var height * with hodo. * Aug 15, 2013 2260 bsteffen Switch poessounding to NSharp. + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -168,8 +169,8 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog { Object[] cols = (Object[]) row; SurfaceObsLocation loc = new SurfaceObsLocation(); loc.setStationId(cols[0].toString()); - loc.setLatitude((Double) cols[1]); - loc.setLongitude((Double) cols[2]); + loc.setLatitude(((Number) cols[1]).floatValue()); + loc.setLongitude(((Number) cols[2]).floatValue()); locs[i++] = loc; } availableStations.put(sourceKey, locs); @@ -195,8 +196,8 @@ public class PointDataCatalog extends AbstractInventoryDataCatalog { } SurfaceObsLocation target = new SurfaceObsLocation(); - target.setLatitude(coordinate.y); - target.setLongitude(coordinate.x); + target.setLatitude((float) coordinate.y); + target.setLongitude((float) coordinate.x); int index = Arrays.binarySearch(availableStations, target, locComparator); if (index < 1) { diff --git a/deltaScripts/14.4.1/DR3410/lonLatDoubleToReal.sh b/deltaScripts/14.4.1/DR3410/lonLatDoubleToReal.sh new file mode 100755 index 0000000000..a113c4e239 --- /dev/null +++ b/deltaScripts/14.4.1/DR3410/lonLatDoubleToReal.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# DR #3410 - this update script will change columns from Double to Real + +# operate on tables that were built with classes that embed SurfaceObsLocation or AircraftObsLocation +# only these tables contain the column 'locationdefined' +TABLES=$(psql -U awips -d metadata -tc "select table_name from information_schema.columns where column_name = 'locationdefined'") +COLUMNS=(latitude longitude) +PSQL="/awips2/psql/bin/psql" + +# takes two args: a table name and a column name +# alters the column in the table to real +function changeToReal { + echo "INFO: Changing table $1 column $2 to real." + ${PSQL} -U awips -d metadata -c "ALTER TABLE $1 ALTER COLUMN $2 TYPE real;" + if [ $? -ne 0 ]; then + echo "ERROR: Failed to change the column $2 for table $1" + return 1 + fi +} + +msg="INFO: All columns changed successfully" + +for table in ${TABLES[*]} +do + echo "INFO: Altering table $table." + for column in ${COLUMNS[*]} + do + changeToReal $table $column || msg="INFO: Operation completed, some columns could not be changed" + done +done + +echo $msg diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/BufrUADecoder.java b/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/BufrUADecoder.java index ad0ceccde0..abe044a677 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/BufrUADecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/BufrUADecoder.java @@ -31,7 +31,6 @@ import com.raytheon.edex.plugin.bufrua.dao.BufrUADao; import com.raytheon.edex.plugin.bufrua.decoder.AbstractBUFRUAAdapter; import com.raytheon.edex.plugin.bufrua.decoder.BUFRUAAdapterFactory; import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.bufrua.UAObs; import com.raytheon.uf.common.pointdata.PointDataDescription; import com.raytheon.uf.common.pointdata.PointDataView; @@ -79,6 +78,7 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao; * Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin * Mar 19, 2013 1785 bgonzale Added performance status handler and added status * to decodeData. + * Jul 23, 2014 3410 bclement removed call to obs.getDataURI() * * * @author jkorman @@ -148,17 +148,10 @@ public class BufrUADecoder extends AbstractBUFRDecoder { obs.setCorIndicator(cor); obs.setTraceId(traceId); if ((obs = queryStationInfo(obs, traceId)) != null) { - try { - obs.constructDataURI(); + String uri = obs.getDataURI(); - String uri = obs.getDataURI(); - - if (dataSet.add(uri)) { - decodedData.add(obs); - } - } catch (PluginException e) { - logger.error(traceId - + "- Unable to construct dataURI", e); + if (dataSet.add(uri)) { + decodedData.add(obs); } } } diff --git a/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/decoder/GOESSoundingDataAdapter.java b/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/decoder/GOESSoundingDataAdapter.java index 59261c7e40..b8ed4f5251 100644 --- a/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/decoder/GOESSoundingDataAdapter.java +++ b/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/decoder/GOESSoundingDataAdapter.java @@ -62,6 +62,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; * May 09, 2013 1869 bsteffen Modified D2D time series of point data to * work without dataURI. * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -188,7 +189,8 @@ public class GOESSoundingDataAdapter { SPIEntry s = SPI_DATA.nearest(lat, lon, MAX_DISTANCE); if (s != null) { SurfaceObsLocation location = new SurfaceObsLocation(); - location.assignLocation(lat, lon); + location.assignLocation(lat.floatValue(), + lon.floatValue()); location.setStationId(s.getId()); obsData.setLocation(location); } else { diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java index 46865d1d68..6dd7550718 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java @@ -49,7 +49,6 @@ import com.raytheon.edex.plugin.IBinaryDecoder; import com.raytheon.edex.plugin.ldad.common.DecodedData; import com.raytheon.edex.plugin.ldad.common.LdadField; import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.ldadhydro.HydroLdadRecord; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; @@ -70,6 +69,7 @@ import com.raytheon.uf.common.time.DataTime; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * 10/16/13 DR 16685 M.Porricelli Add error checking for date * format + * Jul 23, 2014 3410 bclement location changed to floats * * * @author vkorolev @@ -169,12 +169,12 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { } } if (nn.equals("_lat")) { - double val = Double.parseDouble(vv); + float val = Float.parseFloat(vv); location.setLatitude(val); continue; } if (nn.equals("_lon")) { - double val = Double.parseDouble(vv); + float val = Float.parseFloat(vv); location.setLongitude(val); continue; } @@ -203,7 +203,6 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { DataTime dt = new DataTime(ot); record.setDataTime(dt); record.setLocation(location); - record.constructDataURI(); retVal.add(record); } // logger.info("-------------------------------------------------------"); @@ -219,8 +218,6 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { logger.error(traceId + " - SecurityException:" + e); } catch (IllegalArgumentException e) { logger.error(traceId + " - IllegalArgumentException:" + e); - } catch (PluginException e) { - logger.error(traceId + " - PluginException:" + e); } } return retVal.toArray(new PluginDataObject[retVal.size()]); @@ -242,14 +239,13 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { * @throws Throwable */ - @SuppressWarnings("unchecked") public void setProperty(String name, Object obj, String value, String vunit) { String prop = Character.toUpperCase(name.charAt(0)) + name.substring(1); String mname = "set" + prop; Object val = null; try { - Class cls = obj.getClass(); + Class cls = obj.getClass(); Field fld = cls.getDeclaredField(name); Class clazz = fld.getType(); // Type filter @@ -319,11 +315,10 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { } // List of Fields in record - @SuppressWarnings("unchecked") public static void main(String args[]) { HydroLdadRecord record = new HydroLdadRecord(); try { - Class cls = record.getClass(); + Class cls = record.getClass(); Field fieldlist[] = cls.getDeclaredFields(); for (Field fld : fieldlist) { diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java index 7b1ac16bec..7edcba9873 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java @@ -48,7 +48,6 @@ import com.raytheon.edex.plugin.IBinaryDecoder; import com.raytheon.edex.plugin.ldad.common.DecodedData; import com.raytheon.edex.plugin.ldad.common.LdadField; import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.PathManagerFactory; @@ -66,6 +65,7 @@ import com.raytheon.uf.common.time.DataTime; * ------------ ---------- ----------- -------------------------- * Sep 30, 2009 vkorolev Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Jul 23, 2014 3410 bclement location changed to floats * * * @author vkorolev @@ -163,12 +163,12 @@ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder } } if (nn.equals("_lat")) { - double val = Double.parseDouble(vv); + float val = Float.parseFloat(vv); location.setLatitude(val); continue; } if (nn.equals("_lon")) { - double val = Double.parseDouble(vv); + float val = Float.parseFloat(vv); location.setLongitude(val); continue; } @@ -196,7 +196,6 @@ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder DataTime dt = new DataTime(ot); record.setDataTime(dt); record.setLocation(location); - record.constructDataURI(); retVal.add(record); // logger.info("-------------------------------------------------------"); } @@ -211,8 +210,6 @@ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder logger.error(traceId + " - SecurityException:" + e); } catch (IllegalArgumentException e) { logger.error(traceId + " - IllegalArgumentException:" + e); - } catch (PluginException e) { - logger.error(traceId + " - PluginException:" + e); } } return retVal.toArray(new PluginDataObject[retVal.size()]); diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java index 8649fbe015..cede204355 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java @@ -62,6 +62,7 @@ import com.vividsolutions.jts.geom.Geometry; * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Jun 11, 2014 2061 bsteffen Remove IDecoderGettable + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -2102,7 +2103,7 @@ public class ManualLdadRecord extends PluginDataObject implements * * @return The geometry latitude. */ - public Double getLatitude() { + public Float getLatitude() { return location.getLatitude(); } @@ -2111,7 +2112,7 @@ public class ManualLdadRecord extends PluginDataObject implements * * @return The geometry longitude. */ - public Double getLongitude() { + public Float getLongitude() { return location.getLongitude(); } diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java index a45acb8a52..e368159897 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java @@ -83,6 +83,8 @@ import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; * Sep 17, 2013 2378 njensen Improve 3/6 hr precip decoding * May 12, 2014 DR 17151 D. Friedman Fix 6hr min/max temp decoding. * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats + * * * * @author bphillip @@ -288,8 +290,8 @@ public class MetarDecoder extends AbstractDecoder { ObStation station = getStationInfo(icao); if (station != null) { SurfaceObsLocation loc = new SurfaceObsLocation(icao); - Double lat = station.getGeometry().getY(); - Double lon = station.getGeometry().getX(); + float lat = (float) station.getGeometry().getY(); + float lon = (float) station.getGeometry().getX(); loc.assignLocation(lat, lon); loc.setElevation(station.getElevation()); diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java index f2b65b2478..c22ff487b6 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java @@ -62,6 +62,7 @@ import com.raytheon.uf.edex.decodertools.core.DecoderTools; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Dec 16, 2013 DR 16920 D. Friemdan Fix type of tempFromTenths access. * May 14, 2014 2536 bclement removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -389,8 +390,8 @@ public class MetarPointDataTransform { SurfaceObsLocation loc = new SurfaceObsLocation( pdv.getString(STATION_NAME)); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); mr.setLocation(loc); diff --git a/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/decoder/POESSoundingDataAdapter.java b/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/decoder/POESSoundingDataAdapter.java index 95c61f5bef..019b40133a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/decoder/POESSoundingDataAdapter.java +++ b/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/decoder/POESSoundingDataAdapter.java @@ -60,6 +60,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; * Jul 17, 2013 2112 bsteffen Split poes data so it gets stored in * correct file. * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -168,7 +169,8 @@ public class POESSoundingDataAdapter { SPIEntry s = SPI_DATA.nearest(lat, lon, MAX_DISTANCE); if (s != null) { SurfaceObsLocation location = new SurfaceObsLocation(); - location.assignLocation(lat, lon); + location.assignLocation(lat.floatValue(), + lon.floatValue()); location.setStationId(s.getId()); obsData.setLocation(location); diff --git a/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/decoder/ProfilerDataAdapter.java b/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/decoder/ProfilerDataAdapter.java index 62dadf548a..b75ab0a606 100644 --- a/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/decoder/ProfilerDataAdapter.java +++ b/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/decoder/ProfilerDataAdapter.java @@ -62,6 +62,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; * Dec 03, 2013 2537 bsteffen Switch logger to ufstatus. * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage * added breaks/default to switch + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -212,7 +213,7 @@ public class ProfilerDataAdapter { ProfilerSite site = profilers.get(wmoBSN); if (site != null) { location.setStationId(site.getStationId()); - location.assignLocation(lat, lon); + location.assignLocation(lat.floatValue(), lon.floatValue()); location.setLocationDefined(false); if (stationHeight != IDecoderConstants.VAL_MISSING) { location.setElevation(stationHeight); diff --git a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/buoy/DRIBUSynopticDecoder.java b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/buoy/DRIBUSynopticDecoder.java index aa999dc7ec..2d6ba00d88 100644 --- a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/buoy/DRIBUSynopticDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/buoy/DRIBUSynopticDecoder.java @@ -36,6 +36,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20070928 391 jkorman Initial Coding. + * Jul 23, 2014 3410 bclement location changed to floats * * * @author jkorman @@ -47,9 +48,9 @@ public class DRIBUSynopticDecoder extends AbstractSynopticDecoder { // private Integer dateMM = null; // Month // private Integer dateJ = null; // Units digit of year // private Integer dategg = null; // Minutes - private Double buoyLatitude = null; + private Float buoyLatitude = null; - private Double buoyLongitude = null; + private Float buoyLongitude = null; private Integer buoyQuadrant = null; @@ -183,21 +184,21 @@ public class DRIBUSynopticDecoder extends AbstractSynopticDecoder { reportParser.next(); String element = reportParser.getElement(); Integer lat = null; - double divisor = 1000.0; + float divisor = 1000.0f; if (matchElement(element, "[1357]\\d{5}")) { buoyQuadrant = getInt(element, 0, 1); lat = getInt(element, 1, 6); } else if (matchElement(element, "[1357]\\d{4}/")) { buoyQuadrant = getInt(element, 0, 1); lat = getInt(element, 1, 5); - divisor = 100.0; + divisor = 100.0f; } else if (matchElement(element, "[1357]\\d{3}//")) { buoyQuadrant = getInt(element, 0, 1); lat = getInt(element, 1, 4); - divisor = 10.0; + divisor = 10.0f; } if ((lat != null) && (lat >= 0)) { - buoyLatitude = lat.doubleValue() / divisor; + buoyLatitude = lat.floatValue() / divisor; } else { buoyLatitude = null; } @@ -216,18 +217,18 @@ public class DRIBUSynopticDecoder extends AbstractSynopticDecoder { reportParser.next(); String element = reportParser.getElement(); Integer lon = null; - double divisor = 1000.0; + float divisor = 1000.0f; if (matchElement(element, "\\d{6}")) { lon = getInt(element, 0, 6); } else if (matchElement(element, "\\d{5}/")) { lon = getInt(element, 0, 5); - divisor = 100.0; + divisor = 100.0f; } else if (matchElement(element, "\\d{4}//")) { lon = getInt(element, 0, 4); - divisor = 10.0; + divisor = 10.0f; } if ((lon != null) && (lon >= 0)) { - buoyLongitude = lon.doubleValue() / divisor; + buoyLongitude = lon.floatValue() / divisor; } else { buoyLongitude = null; } @@ -242,8 +243,8 @@ public class DRIBUSynopticDecoder extends AbstractSynopticDecoder { if ((buoyLatitude != null) && (buoyLongitude != null) && (buoyQuadrant != null)) { if ((buoyLatitude >= 0) && (buoyLongitude >= 0)) { - double lat = 0; - double lon = 0; + float lat = 0; + float lon = 0; switch (buoyQuadrant) { case 1: { lat = 1; diff --git a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/MobileSynopticDecoder.java b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/MobileSynopticDecoder.java index a3d3bccdf9..35856853e9 100644 --- a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/MobileSynopticDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/MobileSynopticDecoder.java @@ -39,6 +39,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 20070928 391 jkorman Initial Coding. + * Jul 23, 2014 3410 bclement location changed to floats * * * @author jkorman @@ -49,9 +50,9 @@ public class MobileSynopticDecoder extends AbstractSynopticDecoder { // The logger private Log logger = LogFactory.getLog(getClass()); - private Double mobileLatitude = null; + private Float mobileLatitude = null; - private Double mobileLongitude = null; + private Float mobileLongitude = null; private Integer mobileQuadrant = null; @@ -173,7 +174,7 @@ public class MobileSynopticDecoder extends AbstractSynopticDecoder { if (matchElement(element, "99\\d{3}")) { Integer lat = getInt(element, 2, 5); if (lat != null) { - mobileLatitude = lat.doubleValue() / 10.0; + mobileLatitude = lat.floatValue() / 10.0f; } } } @@ -192,7 +193,7 @@ public class MobileSynopticDecoder extends AbstractSynopticDecoder { if (matchElement(element, "[1357]((0\\d{3})|(1(([0-7]\\d{2})|(800))))")) { Integer lon = getInt(element, 2, 5); if (lon != null) { - mobileLongitude = lon.doubleValue() / 10.0; + mobileLongitude = lon.floatValue() / 10.0f; } mobileQuadrant = getInt(element, 0, 1); } @@ -207,8 +208,8 @@ public class MobileSynopticDecoder extends AbstractSynopticDecoder { if ((mobileLatitude != null) && (mobileLongitude != null) && (mobileQuadrant != null)) { if ((mobileLatitude >= 0) && (mobileLongitude >= 0)) { - double lat = 0; - double lon = 0; + float lat = 0; + float lon = 0; switch (mobileQuadrant) { case 1: { lat = 1; diff --git a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/SHIPSynopticDecoder.java b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/SHIPSynopticDecoder.java index 7999f947ae..ee266e6e0e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/SHIPSynopticDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/decoder/synoptic/SHIPSynopticDecoder.java @@ -49,6 +49,7 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao; * 20080108 721 jkorman Added buoy id query. * 20120619 DR 14015 mporricelli Added elevation for fixed buoys * Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin + * Jul 23, 2014 3410 bclement location changed to floats * * * @author jkorman @@ -58,9 +59,9 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder { // The logger private Log logger = LogFactory.getLog(getClass()); - protected Double shipLatitude = null; + protected Float shipLatitude = null; - protected Double shipLongitude = null; + protected Float shipLongitude = null; protected Integer shipElev = null; @@ -161,8 +162,8 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder { // with the spi files - shipLatitude = buoyLat; - shipLongitude = buoyLon; + shipLatitude = buoyLat != null ? buoyLat.floatValue() : null; + shipLongitude = buoyLon != null ? buoyLon.floatValue() : null; shipElev = buoyElev; if ((shipLatitude == null) || (shipLongitude == null)) { clearSectionDecoders(); @@ -222,7 +223,7 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder { if (matchElement(element, "99\\d{3}")) { Integer lat = getInt(element, 2, 5); if ((lat != null) && (lat >= 0)) { - shipLatitude = lat.doubleValue() / 10.0; + shipLatitude = lat.floatValue() / 10.0f; } else { shipLatitude = null; } @@ -240,7 +241,7 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder { if (matchElement(element, "[1357]((0\\d{3})|(1(([0-7]\\d{2})|(800))))")) { Integer lon = getInt(element, 1, 5); if ((lon != null) && (lon >= 0)) { - shipLongitude = lon.doubleValue() / 10.0; + shipLongitude = lon.floatValue() / 10.0f; } else { shipLongitude = null; } @@ -257,8 +258,8 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder { if ((shipLatitude != null) && (shipLongitude != null) && (shipQuadrant != null)) { if ((shipLatitude >= 0) && (shipLongitude >= 0)) { - double lat = 0; - double lon = 0; + float lat = 0; + float lon = 0; switch (shipQuadrant) { case 1: { lat = 1; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airport.java b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airport.java index a3e8341928..42385f71e7 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airport.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/tools/Airport.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 16, 2009 jkorman Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -46,10 +47,10 @@ public class Airport { private String id; @XmlElement - private Double latitude; + private Float latitude; @XmlElement - private Double longitude; + private Float longitude; @XmlElement private Double elevation; @@ -98,7 +99,7 @@ public class Airport { /** * @return the latitude */ - public Double getLatitude() { + public Float getLatitude() { return latitude; } @@ -106,14 +107,14 @@ public class Airport { * @param latitude * the latitude to set */ - public void setLatitude(Double latitude) { + public void setLatitude(Float latitude) { this.latitude = latitude; } /** * @return the longitude */ - public Double getLongitude() { + public Float getLongitude() { return longitude; } @@ -121,7 +122,7 @@ public class Airport { * @param longitude * the longitude to set */ - public void setLongitude(Double longitude) { + public void setLongitude(Float longitude) { this.longitude = longitude; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java index 45fb608ac1..7bf9218402 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java @@ -21,6 +21,7 @@ package com.raytheon.uf.common.dataplugin.bufrua.dao; import java.util.ArrayList; import java.util.Arrays; +import java.util.Date; import java.util.List; import org.apache.commons.logging.Log; @@ -33,7 +34,7 @@ import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.edex.decodertools.time.TimeTools; +import com.raytheon.uf.common.time.util.TimeUtil; /** * Converts a PointDataContainer into a UAObs record. @@ -48,6 +49,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Jul 19, 2013 1992 bsteffen Remove redundant time columns from * bufrua. * Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -109,14 +111,14 @@ public class BufrUAPointDataTransform { long vt = pdv.getNumber("validTime").longValue(); - obs.setDataTime(new DataTime(TimeTools.newCalendar(vt))); + obs.setDataTime(new DataTime(TimeUtil.newGmtCalendar(new Date(vt)))); SurfaceObsLocation location = new SurfaceObsLocation(); int elev = pdv.getNumber("staElev").intValue(); location.setElevation(elev); - double lat = pdv.getNumber("latitude").doubleValue(); - double lon = pdv.getNumber("longitude").doubleValue(); + float lat = pdv.getNumber("latitude").floatValue(); + float lon = pdv.getNumber("longitude").floatValue(); location.assignLocation(lat, lon); Number sta = pdv.getNumber("wmoStaNum"); location.setStationId(sta.toString()); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecordTransform.java b/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecordTransform.java index b16fbd19af..8cccb8fbc8 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecordTransform.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecordTransform.java @@ -20,12 +20,13 @@ package com.raytheon.uf.common.dataplugin.fssobs; import java.util.ArrayList; +import java.util.Date; import java.util.List; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; -import com.raytheon.uf.edex.decodertools.time.TimeTools; +import com.raytheon.uf.common.time.util.TimeUtil; /** * Provides a transform from PointDataContainer to FSSObsRecord. @@ -37,6 +38,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 8, 2011 skorolev Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -187,8 +189,8 @@ public class FSSObsRecordTransform { obs.setDataURI(pdv.getString(DATA_URI)); SurfaceObsLocation loc = new SurfaceObsLocation( pdv.getString(PLATFORM_ID)); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); obs.setLocation(loc); @@ -228,9 +230,9 @@ public class FSSObsRecordTransform { obs.setStnName(pdv.getString(STATION_NAME)); obs.setTemperature(pdv.getFloat(TEMPERATURE)); long to = pdv.getLong(TIME_OBS); - obs.setTimeObs(TimeTools.newCalendar(to)); + obs.setTimeObs(TimeUtil.newGmtCalendar(new Date(to))); long rh = pdv.getLong(REF_HOUR); - obs.setRefHour(TimeTools.newCalendar(rh)); + obs.setRefHour(TimeUtil.newGmtCalendar(new Date(rh))); obs.setTotCloudAmount(pdv.getNumber(CLOUD_AMOUNT_TOT).intValue()); obs.setVisibility(pdv.getNumber(VISIBILITY).floatValue()); obs.setHighResWaveHeight(pdv.getFloat(WAVE_HEIGHT)); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java index ed82b06a2f..177c3dd6d7 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java @@ -43,6 +43,7 @@ import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; * ------------ ---------- ----------- -------------------------- * Oct 09, 2009 DR2814 vkorolev Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -477,8 +478,8 @@ public class LdadmesonetPointDataTransform { mr.setDewpoint(pdv.getNumber(DEWPOINT).floatValue()); SurfaceObsLocation loc = new SurfaceObsLocation( pdv.getString(STATION_ID)); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); mr.setLocation(loc); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.modelsounding/src/com/raytheon/uf/common/dataplugin/modelsounding/ModelSoundingPointDataTransform.java b/edexOsgi/com.raytheon.uf.common.dataplugin.modelsounding/src/com/raytheon/uf/common/dataplugin/modelsounding/ModelSoundingPointDataTransform.java index fd45a331cd..88a1a3a12d 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.modelsounding/src/com/raytheon/uf/common/dataplugin/modelsounding/ModelSoundingPointDataTransform.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.modelsounding/src/com/raytheon/uf/common/dataplugin/modelsounding/ModelSoundingPointDataTransform.java @@ -62,6 +62,7 @@ import com.raytheon.uf.common.time.DataTime; * ------------- -------- ----------- -------------------------- * Apr 06, 2011 bsteffen Initial creation * Dec 02, 2013 2537 bsteffen Move to common + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -156,11 +157,11 @@ public class ModelSoundingPointDataTransform { // All of these things would have been in dataURI if (parameters.contains(LATITUDE)) { site.getLocation().setLatitude( - pdv.getNumber(LATITUDE).doubleValue()); + pdv.getNumber(LATITUDE).floatValue()); } if (parameters.contains(LONGITUDE)) { site.getLocation().setLongitude( - pdv.getNumber(LONGITUDE).doubleValue()); + pdv.getNumber(LONGITUDE).floatValue()); } if (parameters.contains(STATION_ID)) { site.getLocation().setStationId(pdv.getString(STATION_ID)); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java index 7c8e74f20b..5e75b7c804 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java @@ -87,6 +87,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Feb 11, 2014 2784 rferrel Remove override of setIdentifier. * Jun 11, 2014 2061 bsteffen Remove IDecoderGettable + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -1214,7 +1215,7 @@ public class MetarRecord extends PersistablePluginDataObject implements return false; } - Double lat = location.getLatitude(); + Float lat = location.getLatitude(); if (lat == null) { if (other.location.getLatitude() != null) { return false; @@ -1224,7 +1225,7 @@ public class MetarRecord extends PersistablePluginDataObject implements return false; } } - Double lon = location.getLongitude(); + Float lon = location.getLongitude(); if (lon == null) { if (other.location.getLongitude() != null) { return false; diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/dao/ProfilerDataTransform.java b/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/dao/ProfilerDataTransform.java index adc09d76d9..740ca02158 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/dao/ProfilerDataTransform.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/dao/ProfilerDataTransform.java @@ -45,6 +45,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * ------------- -------- ----------- -------------------------- * Oct 28, 2009 jkorman Initial creation * Dec 03, 2013 2537 bsteffen Switch logger to ufstatus. + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -112,8 +113,8 @@ public class ProfilerDataTransform { int elev = pdv.getNumber("elevation").intValue(); location.setElevation(elev); - double lat = pdv.getNumber("latitude").doubleValue(); - double lon = pdv.getNumber("longitude").doubleValue(); + float lat = pdv.getNumber("latitude").floatValue(); + float lon = pdv.getNumber("longitude").floatValue(); location.assignLocation(lat, lon); location.setStationId(pdv.getString("stationId")); obs.setLocation(location); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java index 8d5816ff6e..36e71e95ad 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java @@ -61,6 +61,7 @@ import com.vividsolutions.jts.geom.Geometry; * PluginDataObject. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Oct 22, 2013 2361 njensen Remove XML annotations + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -146,8 +147,8 @@ public class TropicalCycloneSummary extends PersistablePluginDataObject displayTime = ""; } - public TropicalCycloneSummary(String name, int pressure, double longitude, - double latitude, String displayTime, int wind, boolean tropical) { + public TropicalCycloneSummary(String name, int pressure, float longitude, + float latitude, String displayTime, int wind, boolean tropical) { this.name = name; this.pressure = pressure; location = new SurfaceObsLocation(name); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/util/Util.java b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/util/Util.java index 0c44f609f4..04f89ed389 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/util/Util.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/util/Util.java @@ -39,6 +39,7 @@ import com.raytheon.uf.common.time.DataTime; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Oct 30, 2010 jsanchez Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -60,7 +61,7 @@ public class Util implements TCSConstants { DataTime dataTime) { TropicalCycloneSummary tcs = null; - double t1 = 0.0, t2 = 0.0, tf = 0.0, dt = 0.0, tc = 0.0; + float t1 = 0.0f, t2 = 0.0f, tf = 0.0f, dt = 0.0f, tc = 0.0f; Calendar calendar = dataTime.getRefTimeAsCalendar(); int day = dataTime.getValidTime().get(Calendar.DAY_OF_MONTH); @@ -68,8 +69,8 @@ public class Util implements TCSConstants { boolean tropical = true; int wind = 0; - double lat = 29.0; // This came from TCMplotter.C - double lon = -89.6; // This came from TCMplotter.C + float lat = 29.0f; // This came from TCMplotter.C + float lon = -89.6f; // This came from TCMplotter.C String dTime = "Dissipated"; int size = pdv.getInt(SIZE); @@ -83,8 +84,8 @@ public class Util implements TCSConstants { if (size < 2) { if (size > 0) { // set location at last one - lat = latitude[size - 1].doubleValue(); - lon = longitude[size - 1].doubleValue(); + lat = latitude[size - 1].floatValue(); + lon = longitude[size - 1].floatValue(); } return new TropicalCycloneSummary(name, 0, lon, lat, dTime, windSpeed[size - 1].intValue(), @@ -105,7 +106,7 @@ public class Util implements TCSConstants { if (dataTime.getValidTime().getTimeInMillis() == dataTime.getRefTime() .getTime()) { tcs = new TropicalCycloneSummary(name, pressure, - longitude[0].doubleValue(), latitude[0].doubleValue(), + longitude[0].floatValue(), latitude[0].floatValue(), displayTime[0], windSpeed[0].intValue(), isTropical[0].intValue() == 1 ? true : false); tcs.setRadiusList(loadRadiusList(pdv, 0)); @@ -129,7 +130,7 @@ public class Util implements TCSConstants { if (tc < 0.01) { tcs = new TropicalCycloneSummary(name, 0, - longitude[i].doubleValue(), latitude[i].doubleValue(), + longitude[i].floatValue(), latitude[i].floatValue(), displayTime[i], windSpeed[i].intValue(), isTropical[i].intValue() == 1 ? true : false); tcs.setRadiusList(loadRadiusList(pdv, i)); @@ -146,8 +147,8 @@ public class Util implements TCSConstants { if (i >= size) { if (size > 0) { // set location at last one - lat = latitude[size - 1].doubleValue(); - lon = longitude[size - 1].doubleValue(); + lat = latitude[size - 1].floatValue(); + lon = longitude[size - 1].floatValue(); } return new TropicalCycloneSummary(name, 0, lon, lat, dTime, windSpeed[size - 1].intValue(), diff --git a/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/VerticalSounding.java b/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/VerticalSounding.java index fe6880f9a4..acb27edec7 100644 --- a/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/VerticalSounding.java +++ b/edexOsgi/com.raytheon.uf.common.sounding/src/com/raytheon/uf/common/sounding/VerticalSounding.java @@ -48,6 +48,7 @@ import com.vividsolutions.jts.geom.Geometry; * 15Jan2008 682 ebabin Updated to remove non calculated parameters. * 16Jan2008 682 ebabin Updates for grib model traps on multiple loads. * 04Oct2008 dhladky Many changes. + * Jul 23, 2014 3410 bclement location changed to floats * * * @author jkorman @@ -598,7 +599,7 @@ public class VerticalSounding implements Iterable, Cloneable { * Set the geometry latitude. * */ - public void setLatitude(double latitude) { + public void setLatitude(float latitude) { spatialInfo.setLatitude(latitude); } @@ -606,7 +607,7 @@ public class VerticalSounding implements Iterable, Cloneable { * Set the geometry longitude. * */ - public void setLongitude(double longitude) { + public void setLongitude(float longitude) { spatialInfo.setLongitude(longitude); } diff --git a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java index 86e29e7f46..5ddbc091d9 100644 --- a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java @@ -57,6 +57,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Jul 16, 2009 jkorman Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Jun 11, 2014 2061 bsteffen Remove IDecoderGettable + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -255,13 +256,13 @@ public class PluginDataObjectFilter extends AbstractObsFilter { TestObject p = new TestObject(); p.location = new SurfaceObsLocation("1.1"); - p.location.assignLocation(.8, .8); + p.location.assignLocation(.8f, .8f); p = (TestObject) element.filter(p); System.out.println((p == null) ? "passed" : "failed"); p = new TestObject(); p.location = new SurfaceObsLocation("1.2"); - p.location.assignLocation(.7, .7); + p.location.assignLocation(.7f, .7f); p = (TestObject) element.filter(p); System.out.println((p == null) ? "failed" : p); @@ -271,13 +272,13 @@ public class PluginDataObjectFilter extends AbstractObsFilter { p = new TestObject(); p.location = new SurfaceObsLocation("2.1"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78f, -97.65f); // KSLN 38 47N 097 39W p = (TestObject) element.filter(p); System.out.println((p == null) ? p : "failed"); p = new TestObject(); p.location = new SurfaceObsLocation("2.2"); - p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W + p.location.assignLocation(39.13f, -96.68f); // KMHK 39 08N 096 41W p = (TestObject) element.filter(p); System.out.println((p != null) ? p : "failed"); @@ -299,17 +300,17 @@ public class PluginDataObjectFilter extends AbstractObsFilter { PluginDataObject[] pp = new PluginDataObject[3]; p = new TestObject(); p.location = new SurfaceObsLocation("KSLN"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78f, -97.65f); // KSLN 38 47N 097 39W pp[0] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KMHK"); - p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W + p.location.assignLocation(39.13f, -96.68f); // KMHK 39 08N 096 41W pp[1] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KSTJ"); - p.location.assignLocation(41, -96.00); + p.location.assignLocation(41f, -96.00f); pp[2] = p; pp = filter.filter(pp); @@ -326,22 +327,22 @@ public class PluginDataObjectFilter extends AbstractObsFilter { p = new TestObject(); p.location = new SurfaceObsLocation("KORD"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78f, -97.65f); // KSLN 38 47N 097 39W pp[0] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KSLN"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78f, -97.65f); // KSLN 38 47N 097 39W pp[1] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KMHK"); - p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W + p.location.assignLocation(39.13f, -96.68f); // KMHK 39 08N 096 41W pp[2] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KSTJ"); - p.location.assignLocation(41, -96.00); + p.location.assignLocation(41f, -96.00f); pp[3] = p; filter = new PluginDataObjectFilter(); diff --git a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java index f96c866667..6bd16b08f3 100644 --- a/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java +++ b/edexOsgi/com.raytheon.uf.edex.ogc.common/src/com/raytheon/uf/edex/ogc/common/feature/ObsLocation.java @@ -43,6 +43,7 @@ import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 24, 2013 1746 dhladky Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -74,8 +75,8 @@ public class ObsLocation { this.setStationId(sol.getStationId()); this.setElevation(sol.getElevation()); - Double lat = sol.getLatitude(); - Double lon = sol.getLongitude(); + Double lat = sol.getLatitude().doubleValue(); + Double lon = sol.getLongitude().doubleValue(); PointType point = new PointType(); DirectPositionType pos = new DirectPositionType(); pos.setValue(Arrays.asList(lon, lat)); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java index 2c863883fe..b1196dabb2 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java @@ -46,9 +46,9 @@ import com.raytheon.uf.edex.decodertools.bufr.packets.IBUFRDataPacket; /** * Adapter used to decode ACARS data in BUFR format. - * + * *
- *
+ * 
  * SOFTWARE HISTORY
  * Date          Ticket#  Engineer    Description
  * ------------- -------- ----------- --------------------------
@@ -59,9 +59,10 @@ import com.raytheon.uf.edex.decodertools.bufr.packets.IBUFRDataPacket;
  * May 14, 2014  2536     bclement    moved WMO Header to common, removed TimeTools usage
  * Jun 12, 2014  2061     bsteffen    Generate unique stationid
  * Jul 22, 2014  3392     nabowle     ACARSRecord has Float fields instead of Double
- *
+ * Jul 23, 2014  3410     bclement    location changed to floats
+ * 
  * 
- * + * * @author jkorman * @version 1.0 */ @@ -485,8 +486,8 @@ public class ACARSDataAdapter { if ((lat != null) && (lon != null)) { loc = new AircraftObsLocation(); - loc.setLatitude(lat); - loc.setLongitude(lon); + loc.setLatitude(lat.floatValue()); + loc.setLongitude(lon.floatValue()); loc.setLocation(lat, lon); // We can pick up the height here for some data. Have to look @@ -538,8 +539,8 @@ public class ACARSDataAdapter { if ((lat != null) && (lon != null)) { loc = new AircraftObsLocation(); - loc.setLatitude(lat); - loc.setLongitude(lon); + loc.setLatitude(lat.floatValue()); + loc.setLongitude(lon.floatValue()); loc.setLocation(lat, lon); generateStationId(loc); } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java index 79c0cb44fc..a6a6c8a59a 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java @@ -50,6 +50,7 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao; * types. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -137,7 +138,7 @@ public class AScatDataAdapter extends BUFRPointDataAdapter { IDecoderConstants.VAL_MISSING); SurfaceObsLocation location = new SurfaceObsLocation(); - location.assignLocation(lat, lon); + location.assignLocation((float) lat, (float) lon); location.generateCoordinateStationId(); obsData.setLocation(location); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java index 7213d4e0de..799aace40c 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java @@ -51,6 +51,7 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao; * types. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -220,8 +221,8 @@ public class HDWDataAdapter extends BUFRPointDataAdapter { IDecoderConstants.VAL_MISSING); SurfaceObsLocation location = new SurfaceObsLocation(); - location.setLatitude(lat); - location.setLongitude(lon); + location.setLatitude((float) lat); + location.setLongitude((float) lon); location.generateCoordinateStationId(); pointData.setLocation(location); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java index ea7af8268e..c0b7356789 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java @@ -52,6 +52,7 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao; * types. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -225,8 +226,8 @@ public class MTHDWDataAdapter extends BUFRPointDataAdapter { IDecoderConstants.VAL_MISSING); SurfaceObsLocation location = new SurfaceObsLocation(); - location.setLatitude(lat); - location.setLongitude(lon); + location.setLatitude((float) lat); + location.setLongitude((float) lon); location.generateCoordinateStationId(); pointData.setLocation(location); // **************************************** diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java index a17d785cad..ab1e6968ee 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java @@ -58,6 +58,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Aug 17, 2009 jkorman Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -82,21 +83,21 @@ public class BUFRncwfDataAdapter extends BUFRPointDataAdapter { private static final int FEATURES_POS = 6; - private static final int FEATURE_TIMSIG_POS = 0; + // private static final int FEATURE_TIMSIG_POS = 0; - private static final int FEATURE_TIMEPD_POS = 1; + // private static final int FEATURE_TIMEPD_POS = 1; - private static final int FEATURE_ATTSIG_POS = 2; + // private static final int FEATURE_ATTSIG_POS = 2; - private static final int FEATURE_DIMSIG_POS = 3; + // private static final int FEATURE_DIMSIG_POS = 3; private static final int FEATURE_LAT_POS = 4; private static final int FEATURE_LON_POS = 5; - private static final int BOUNDARY_ATTSIG_POS = 6; + // private static final int BOUNDARY_ATTSIG_POS = 6; - private static final int BOUNDARY_DIMSIG_POS = 7; + // private static final int BOUNDARY_DIMSIG_POS = 7; private static final int BOUNDARY_SUBLIST_POS = 8; @@ -253,9 +254,11 @@ public class BUFRncwfDataAdapter extends BUFRPointDataAdapter { Coordinate centroid = ncwfReport.getDetection() .getCentroidLocation(); SurfaceObsLocation loc = new SurfaceObsLocation(); - loc.assignLocation( - DecoderTools.getCoordinateLatitude(centroid), - DecoderTools.getCoordinateLongitude(centroid)); + float lat = (float) DecoderTools + .getCoordinateLatitude(centroid); + float lon = (float) DecoderTools + .getCoordinateLongitude(centroid); + loc.assignLocation(lat, lon); ncwfReport.setLocation(loc); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/AbstractBufrSfcObsDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/AbstractBufrSfcObsDecoder.java index 8ca4998f39..a95095973a 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/AbstractBufrSfcObsDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/AbstractBufrSfcObsDecoder.java @@ -91,6 +91,7 @@ import com.raytheon.uf.edex.plugin.bufrobs.category.CategoryParser; * Apr 21, 2014 2906 bclement populated wmo header in record for consistency * Jun 12, 2014 3229 bclement default implementation for getTranslationFile() and createStationId() * moved processGeneralFields() and processPrecip() from synoptic land decoder + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -534,13 +535,13 @@ public abstract class AbstractBufrSfcObsDecoder { } else if (baseName.equalsIgnoreCase(SfcObsPointDataTransform.LATITUDE)) { Double lat = (Double) getFieldValue(parser, false); if (lat != null) { - location.assignLatitude(lat); + location.assignLatitude(lat.floatValue()); } } else if (baseName .equalsIgnoreCase(SfcObsPointDataTransform.LONGITUDE)) { Double lon = (Double) getFieldValue(parser, false); if (lon != null) { - location.assignLongitude(lon); + location.assignLongitude(lon.floatValue()); } } else if (baseName .equalsIgnoreCase(SfcObsPointDataTransform.ELEVATION)) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/buoy/BuoyBufrDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/buoy/BuoyBufrDecoder.java index 8a71e8eb47..22933d0db7 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/buoy/BuoyBufrDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrobs/src/com/raytheon/uf/edex/plugin/bufrobs/buoy/BuoyBufrDecoder.java @@ -39,6 +39,7 @@ import com.raytheon.uf.edex.plugin.bufrobs.BufrObsDecodeException; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 11, 2014 3229 bclement Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -171,7 +172,7 @@ public class BuoyBufrDecoder extends AbstractBufrSfcObsDecoder { throw new BufrObsDecodeException("BUFR file '" + parser.getFile() + "' missing location information"); } - location.assignLocation(lat.doubleValue(), lon.doubleValue()); + location.assignLocation(lat.floatValue(), lon.floatValue()); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java index 1698d27d5e..17778581c2 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java @@ -48,6 +48,7 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao; * Mar 03, 2008 969 jkorman Initial implementation. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -137,7 +138,7 @@ public class QUIKScatDataAdapter extends BUFRPointDataAdapter { IDecoderConstants.VAL_MISSING); SurfaceObsLocation location = new SurfaceObsLocation(); - location.assignLocation(lat, lon); + location.assignLocation((float) lat, (float) lon); obsData.setLocation(location); view.setFloat("latitude", (float) lat); view.setFloat("longitude", (float) lon); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java index 40dc03bd96..6386a64c04 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java @@ -56,6 +56,7 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Oct 21, 2013 2379 bsteffen Fix a null pointer exception. * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -307,7 +308,7 @@ public class SSMIDataAdapter extends BUFRPointDataAdapter { IDecoderConstants.VAL_MISSING); SurfaceObsLocation location = new SurfaceObsLocation(); - location.assignLocation(lat, lon); + location.assignLocation((float) lat, (float) lon); location.generateCoordinateStationId(); pointData.setLocation(location); setViewData("surfaceTag", view, locList.get(2)); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsDataTransform.java b/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsDataTransform.java index 845f267d13..ba591d6da5 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsDataTransform.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/FSSObsDataTransform.java @@ -23,9 +23,6 @@ import java.util.Date; import javax.xml.bind.JAXBException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord; import com.raytheon.uf.common.pointdata.PointDataContainer; @@ -33,6 +30,7 @@ import com.raytheon.uf.common.pointdata.PointDataDescription; import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.time.DataTime; +import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.edex.decodertools.time.TimeTools; /** @@ -45,6 +43,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Dec 3, 2010 skorolev Initial creation + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -54,8 +53,6 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; public class FSSObsDataTransform { - private Log logger = LogFactory.getLog(getClass()); - private FSSObsDAO dao; private static PointDataDescription fsspdd; @@ -290,8 +287,8 @@ public class FSSObsDataTransform { fssr.setReportType(pdv.getString(REPORT_TYPE)); SurfaceObsLocation loc = new SurfaceObsLocation(); loc.setStationId(pdv.getString(STATION_ID)); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); fssr.setLocation(loc); @@ -302,7 +299,7 @@ public class FSSObsDataTransform { fssr.setDataTime(new DataTime(new Date(pdv.getNumber(TIME_OBS) .longValue()))); long to = pdv.getLong(TIME_OBS); - fssr.setTimeObs(TimeTools.newCalendar(to)); + fssr.setTimeObs(TimeUtil.newGmtCalendar(new Date(to))); // nominalTime fssr.setRefHour(TimeTools.roundToNearestHour(fssr.getTimeObs())); // in mbar @@ -458,8 +455,8 @@ public class FSSObsDataTransform { FSSObsRecord fssr = new FSSObsRecord(); SurfaceObsLocation loc = new SurfaceObsLocation(); loc.setStationId(pdv.getString(STATION_ID)); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); fssr.setLocation(loc); @@ -471,7 +468,7 @@ public class FSSObsDataTransform { fssr.setDataTime(new DataTime(new Date(pdv.getNumber(TIME_OBS) .longValue()))); long to = pdv.getLong(TIME_OBS); - fssr.setTimeObs(TimeTools.newCalendar(to)); + fssr.setTimeObs(TimeUtil.newGmtCalendar(new Date(to))); // TODO: check nominalTime fssr.setRefHour(TimeTools.roundToNearestHour(fssr.getTimeObs())); @@ -555,8 +552,8 @@ public class FSSObsDataTransform { fssr.setReportType(pdv.getString(REPORT_TYPE)); SurfaceObsLocation loc = new SurfaceObsLocation(); loc.setStationId(pdv.getString(STATION_ID)); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); fssr.setLocation(loc); @@ -567,7 +564,7 @@ public class FSSObsDataTransform { fssr.setDataTime(new DataTime(new Date(pdv.getNumber(OBSERVATION_TIME) .longValue()))); long to = pdv.getLong(OBSERVATION_TIME); - fssr.setTimeObs(TimeTools.newCalendar(to)); + fssr.setTimeObs(TimeUtil.newGmtCalendar(new Date(to))); fssr.setRefHour(TimeTools.roundToNearestHour(fssr.getTimeObs())); // fssr.setCeiling(pdv.getNumber(CLOUD_BASE_HEIGHT).floatValue()); if (pdv.getFloat(DEWPOINT) != MISSING) { @@ -682,7 +679,7 @@ public class FSSObsDataTransform { * the pdc to set */ public void setPdc(PointDataContainer pdc) { - this.pdc = pdc; + FSSObsDataTransform.pdc = pdc; } /** diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java index c6929e8080..2bff5c21c2 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java @@ -69,6 +69,7 @@ import com.raytheon.uf.common.time.DataTime; * Sep 04, 2009 vkorolev Initial creation * May 15, 2013 1869 bsteffen Remove DataURI column from ldadmesonet. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Jul 23, 2014 3410 bclement location changed to floats * * * @author vkorolev @@ -80,8 +81,6 @@ public class MesonetDecoder extends AbstractDecoder implements private static final String BAD_PROPERTY_FMT = "NumberFormatException setting property %s.%s(%s %s)"; - private final String PLUGIN_NAME; - private String traceId = null; private String currentFile = null; @@ -93,7 +92,6 @@ public class MesonetDecoder extends AbstractDecoder implements public Properties configFile = new Properties(); public MesonetDecoder(String pluginName) throws DecoderException { - PLUGIN_NAME = pluginName; } public void setTraceId(String id) { @@ -211,12 +209,12 @@ public class MesonetDecoder extends AbstractDecoder implements } } if ("_lat".equals(nn)) { - double val = Double.parseDouble(vv); + float val = Float.parseFloat(vv); location.setLatitude(val); continue; } if ("_lon".equals(nn)) { - double val = Double.parseDouble(vv); + float val = Float.parseFloat(vv); location.setLongitude(val); continue; } @@ -427,7 +425,6 @@ public class MesonetDecoder extends AbstractDecoder implements } // List of Fields in record - @SuppressWarnings("unchecked") public static void main(String args[]) { MesonetLdadRecord record = new MesonetLdadRecord(); try { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java index a77a57b76a..d080eea9a7 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java @@ -58,6 +58,7 @@ import com.raytheon.uf.edex.plugin.lsr.LocalStormReportDao; * Jan 07, 2013 2581 njensen Check to end of string for source, not a set length * Jan 13, 2013 2581 njensen Improved error handling and logging * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -450,13 +451,13 @@ public class LSRParser { Matcher m = LATLON_PTRN.matcher(latlon); if (m.find()) { String ss = m.group(2); - Double lat = Double.parseDouble(ss.substring(0, ss.length() - 1)); + float lat = Float.parseFloat(ss.substring(0, ss.length() - 1)); if (ss.endsWith("S")) { lat *= -1; } ss = m.group(4); - Double lon = Double.parseDouble(ss.substring(0, ss.length() - 1)); + float lon = Float.parseFloat(ss.substring(0, ss.length() - 1)); if (ss.endsWith("W")) { lon *= -1; } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/src/com/raytheon/uf/edex/plugin/modelsounding/decoder/ModelSoundingDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/src/com/raytheon/uf/edex/plugin/modelsounding/decoder/ModelSoundingDataAdapter.java index 7dc35fd8f0..1bd35205fe 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/src/com/raytheon/uf/edex/plugin/modelsounding/decoder/ModelSoundingDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/src/com/raytheon/uf/edex/plugin/modelsounding/decoder/ModelSoundingDataAdapter.java @@ -64,6 +64,7 @@ import com.raytheon.uf.edex.plugin.modelsounding.common.SoundingModels; * Jul 03, 2013 2161 bkowal Relocated the logic used to retrieve * temporal information into its own function. * Dec 02, 2013 2537 bsteffen Use SoundingSite setters instead of view. + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -269,7 +270,7 @@ public class ModelSoundingDataAdapter { if (d == BUFRDescriptor.createDescriptor(0, 6, 2)) { lon = (Double) dp.getValue(); } - location.assignLocation(lat, lon); + location.assignLocation(lat.floatValue(), lon.floatValue()); dp = dataList.get(index); d = dp.getReferencingDescriptor().getDescriptor(); if (d == BUFRDescriptor.createDescriptor(0, 10, 194)) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java index f84d8bd4e9..2091de16e4 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java @@ -60,6 +60,7 @@ import com.raytheon.uf.edex.plugin.qc.dao.QCDao; * May 16, 2013 1869 bsteffen Remove DataURI column from qc. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Feb 20, 2014 DR 17098 D. Friedman Filter out invalid lat/lon values. + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -208,8 +209,8 @@ public class QCScanner { while (ri < records.length) { QCRecord r = new QCRecord(); double obsTime = dObsTime.getDouble(ri); - double lat = dLat.getDouble(ri); - double lon = dLon.getDouble(ri); + float lat = dLat.getFloat(ri); + float lon = dLon.getFloat(ri); if ((obsTime != vObsTimeFillValue) && ((vObsTimeMissingValue == null) || (vObsTimeMissingValue != obsTime)) && Math.abs(lon) <= 180 && Math.abs(lat) <= 90) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java index e1e36210b8..b7efb89c05 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java @@ -44,11 +44,11 @@ import com.raytheon.uf.edex.plugin.svrwx.SvrWxRecordDao; /** * SvrWx Parser - * - * + * + * *
- *
- *
+ * 
+ * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
@@ -57,9 +57,10 @@ import com.raytheon.uf.edex.plugin.svrwx.SvrWxRecordDao;
  * Apr 07, 2014 2971       skorolev    Add condition to avoid malformed parts in the message.
  * May 14, 2014 2536       bclement    moved WMO Header to common, removed pluginName
  * Jun 25, 2014 3008       nabowle     Refactor for EventReport type
- *
+ * Jul 23, 2014 3410       bclement    location changed to floats
+ * 
  * 
- * + * * @author jsanchez * @version 1.0 */ @@ -472,25 +473,25 @@ public class SvrWxParser { } /** - * Get the latitude as a double. Northern hemisphere is assumed. - * + * Get the latitude as a float. Northern hemisphere is assumed. + * * @param latlon * The latitude/longitude String. - * @return The latitude as a double. + * @return The latitude as a float. */ - private double getLat(String latlon) { - return Float.parseFloat(parseLat(latlon)) / 100.0D; + private float getLat(String latlon) { + return Float.parseFloat(parseLat(latlon)) / 100.0f; } /** - * Get the longitude as a double. Western hemisphere is assumed. - * + * Get the longitude as a float. Western hemisphere is assumed. + * * @param latlon * The latitude/longitude String. - * @return The longitude as a double. + * @return The longitude as a float. */ - private double getLon(String latlon) { - return Float.parseFloat(parseLon(latlon)) / -100.0D; + private float getLon(String latlon) { + return Float.parseFloat(parseLon(latlon)) / -100.0f; } /** diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java index 4d6c806ba7..1429eb122f 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java @@ -39,19 +39,20 @@ import com.vividsolutions.jts.geom.Coordinate; /** * Parses a subset of Tropical Cyclone Guidance data that contain multiple storm * track predictions from various models such as BAM(S/M/D) and LBAR. - * + * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 26, 2009            jsanchez    Initial creation
  * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
  * Jun 23, 2014 3235       nabowle     Clear the coordinates map properly.
- *
+ * Jul 23, 2014 3410       bclement    location changed to floats
+ * 
  * 
- * + * * @author jsanchez * @version 1.0 */ @@ -95,8 +96,8 @@ public class HURData extends TCGDataAdapter { TropicalCycloneGuidance rpt = new TropicalCycloneGuidance(); SurfaceObsLocation location = new SurfaceObsLocation( stationId); - location.setLongitude(list.get(i).x); - location.setLatitude(list.get(i).y); + location.setLongitude((float) list.get(i).x); + location.setLatitude((float) list.get(i).y); rpt.setWmoHeader(wmoHeader.getWmoHeader()); rpt.setTraceId(traceId); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java index 875d78261a..236dc3949e 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java @@ -45,6 +45,7 @@ import com.raytheon.uf.edex.plugin.tcg.TropicalCycloneGuidanceDao; * so times are set correctly when * processing archive data. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -56,11 +57,11 @@ public class QLMData extends TCGDataAdapter { private class ForecastPosition { public int hour; - public double latitude; + public float latitude; - public double longitude; + public float longitude; - public ForecastPosition(int hour, double lat, double lon) { + public ForecastPosition(int hour, float lat, float lon) { this.hour = hour; this.latitude = lat; this.longitude = lon; @@ -100,8 +101,8 @@ public class QLMData extends TCGDataAdapter { TropicalCycloneGuidance rpt = new TropicalCycloneGuidance(); SurfaceObsLocation location = new SurfaceObsLocation( stationId); - location.setLongitude(fp.longitude); - location.setLatitude(fp.latitude); + location.setLongitude((float) fp.longitude); + location.setLatitude((float) fp.latitude); rpt.setWmoHeader(wmoHeader.getWmoHeader()); rpt.setTraceId(traceId); @@ -155,8 +156,8 @@ public class QLMData extends TCGDataAdapter { String data[] = getParts(positionInfo, 3); int hour = Integer.valueOf(data[0]); - double lat = Double.valueOf(data[1]); - double lon = Double.valueOf(data[2]) * -1; + float lat = Float.valueOf(data[1]); + float lon = Float.valueOf(data[2]) * -1; list.add(new ForecastPosition(hour, lat, lon)); } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java index 112a13b736..44be56aa25 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java @@ -35,20 +35,21 @@ import com.raytheon.uf.edex.plugin.tcg.TropicalCycloneGuidanceDao; /** * TODO Add Description - * + * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Nov 12, 2009            jsanchez    Initial creation
  * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
  * Jun 24, 2014 3235       nabowle     InternalReport patterns are now
  *                                     precompiled.
- *
+ * Jul 23, 2014 3410       bclement    location changed to floats
+ * 
  * 
- * + * * @author jsanchez * @version 1.0 */ @@ -105,8 +106,8 @@ public class TCEData extends TCGDataAdapter { TropicalCycloneGuidance rpt = new TropicalCycloneGuidance(); SurfaceObsLocation location = new SurfaceObsLocation( stationId); - location.setLongitude((double) longitude); - location.setLatitude((double) latitude); + location.setLongitude(longitude); + location.setLatitude(latitude); rpt.setWmoHeader(wmoHeader.getWmoHeader()); rpt.setTraceId(traceId); rpt.setStormName(stormName); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java index 2aa766b722..b7e91d1d73 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java @@ -54,6 +54,7 @@ import com.raytheon.uf.edex.plugin.tcs.TropicalCycloneSummaryDao; * calculate times. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -281,8 +282,8 @@ public class TCMData extends TCSDataAdapter { m = latlonPtrn.matcher(mask); if (m.find()) { SurfaceObsLocation location = new SurfaceObsLocation(); - double latitude = Double.parseDouble(((m.group(1)))); - double longitude = Double.parseDouble((m.group(3))); + float latitude = Float.parseFloat(((m.group(1)))); + float longitude = Float.parseFloat((m.group(3))); location.setLatitude(m.group(2).equals("S") ? -1 * latitude : latitude); location.setLongitude(m.group(4).equals("W") ? -1 * longitude diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java index d080d0942a..35ac33686c 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java @@ -51,6 +51,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; * Feb 11, 2014 2763 skorolev Made LFCR correction of input data. * Mar 10, 2014 2807 skorolev Added MalformedDataException for VAA decoding. * May 14, 2014 2536 bclement moved WMO Header to common + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -59,11 +60,10 @@ import com.raytheon.uf.common.wmo.WMOHeader; */ public class VAAParser implements Iterable { - // TODO should use JTS coordinate private static class LatLon { - public Double lat; + public float lat; - public Double lon; + public float lon; @Override public String toString() { @@ -266,12 +266,12 @@ public class VAAParser implements Iterable { Matcher m = InternalReport.LAT_LON_P.matcher(latLon); if (m.find()) { latlon = new LatLon(); - latlon.lat = Double.parseDouble(m.group(2)); - latlon.lat += (Double.parseDouble(m.group(3)) / 60.0); + latlon.lat = Float.parseFloat(m.group(2)); + latlon.lat += (Float.parseFloat(m.group(3)) / 60.0f); latlon.lat *= ("S".equals(m.group(1))) ? -1 : 1; - latlon.lon = Double.parseDouble(m.group(5)); - latlon.lon += (Double.parseDouble(m.group(6)) / 60.0); + latlon.lon = Float.parseFloat(m.group(5)); + latlon.lon += (Float.parseFloat(m.group(6)) / 60.0f); latlon.lon *= ("W".equals(m.group(4))) ? -1 : 1; } return latlon; diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmBulletin.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmBulletin.java index 2fbe86e3fe..d07b698bd0 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmBulletin.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmBulletin.java @@ -31,10 +31,9 @@ import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.time.DataTime; /** - * NcPafmBulletin is the highest level class for PAFM - * (Point/Area Forecast Matrices) data. Each instance holds - * all of the data parsed from one bulletin. Children - * (NcPafmUgc) hold data from individual segments. + * NcPafmBulletin is the highest level class for PAFM (Point/Area Forecast + * Matrices) data. Each instance holds all of the data parsed from one bulletin. + * Children (NcPafmUgc) hold data from individual segments. * * This code has been developed by the SIB for use in the AWIPS2 system. * @@ -52,6 +51,7 @@ import com.raytheon.uf.common.time.DataTime; * whole bulletin, but no longer the PDO. * Removed persistence annotations. * 12Oct2011 126 G. Hull use a surfaceObsLocation object for the lat/lon/stationId. + * Jul 23, 2014 3410 bclement location changed to floats * * * @author F. J. Yen, SIB @@ -60,8 +60,6 @@ import com.raytheon.uf.common.time.DataTime; public class NcPafmBulletin { - private static final long serialVersionUID = 1L; - /** Report type */ private String reportType; @@ -150,8 +148,8 @@ public class NcPafmBulletin { // npr.setLat(fips.getLat()); // npr.setLon(fips.getLon()); - loc.setLatitude( fips.getLat().doubleValue() ); - loc.setLongitude( fips.getLon().doubleValue() ); + loc.setLatitude(fips.getLat().floatValue()); + loc.setLongitude(fips.getLon().floatValue()); loc.setElevation( fips.getElev().intValue() ); npr.setLocation( loc ); diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java index b47f03347b..ac39490107 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java @@ -19,7 +19,7 @@ import com.raytheon.uf.common.pointdata.PointDataDescription; import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.edex.decodertools.time.TimeTools; +import com.raytheon.uf.common.time.util.TimeUtil; /** * Provides a transform from NcScdRecords to PointDataContainer and vice versa. @@ -33,6 +33,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Sep 08, 2011 294 G. Hull Use SurfaceObsLocation to set lat/lon * Sep 13, 2011 457 S. Gurung Renamed H5 to Nc and h5 to nc * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -209,15 +210,15 @@ public class NcScdPointDataTransform { SurfaceObsLocation loc = new SurfaceObsLocation( pdv.getString(STATION_NAME)); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); long tmptime = pdv.getNumber(ISSUE_TIME).longValue(); - nar.setIssueTime(TimeTools.newCalendar(tmptime)); + nar.setIssueTime(TimeUtil.newGmtCalendar(new Date(tmptime))); tmptime = pdv.getNumber(OBS_TIME).longValue(); - nar.setObsTime(TimeTools.newCalendar(tmptime)); + nar.setObsTime(TimeUtil.newGmtCalendar(new Date(tmptime))); nar.setTDXC(pdv.getNumber(TDXC).floatValue()); nar.setTDNC(pdv.getNumber(TDNC).floatValue()); diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/dao/NcTafToRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/dao/NcTafToRecord.java index 14517885f9..826704e532 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/dao/NcTafToRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/dao/NcTafToRecord.java @@ -14,6 +14,7 @@ * 10/26/2011 S. Gurung Added probable parameters (for TEMPO/PROB) * 11/03/2011 S. Gurung Added additional parameters and renamed some parameters * 11/07/2011 S. Gurung Added LOW_LEVEL_WIND_SHEAR + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -24,6 +25,13 @@ package gov.noaa.nws.ncep.common.dataplugin.nctaf.dao; +import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafIcingLayer; +import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafRecord; +import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafSkyCover; +import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafTemperatureForecast; +import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafTurbulenceLayer; +import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafWeatherCondition; + import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -35,14 +43,6 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; -import com.raytheon.uf.edex.decodertools.time.TimeTools; - -import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafIcingLayer; -import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafRecord; -import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafSkyCover; -import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafTemperatureForecast; -import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafTurbulenceLayer; -import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafWeatherCondition; public class NcTafToRecord { @@ -181,8 +181,8 @@ public class NcTafToRecord { record.setStationId(pdv.getString("STID")); SurfaceObsLocation loc = new SurfaceObsLocation(pdv.getString("STID")); - Double lat = pdv.getNumber(LATITUDE).doubleValue(); - Double lon = pdv.getNumber(LONGITUDE).doubleValue(); + float lat = pdv.getNumber(LATITUDE).floatValue(); + float lon = pdv.getNumber(LONGITUDE).floatValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); record.setLocation(loc); @@ -234,18 +234,15 @@ public class NcTafToRecord { record.setSequenceId(pdv.getInt("SEQID")); if (parameters.contains("END_DATE")) { - long vt = pdv.getNumber("END_DATE").longValue(); - record.setEndDate(TimeTools.newCalendar(vt)); + record.setEndDate(pdv.getCalendar("END_DATE")); } if (parameters.contains("START_DATE")) { - long vt = pdv.getNumber("START_DATE").longValue(); - record.setStartDate(TimeTools.newCalendar(vt)); + record.setStartDate(pdv.getCalendar("START_DATE")); } if (parameters.contains("TRANS_END_DATE")) { - long vt = pdv.getNumber("TRANS_END_DATE").longValue(); - record.setTransitionEndDate(TimeTools.newCalendar(vt)); + record.setTransitionEndDate(pdv.getCalendar("TRANS_END_DATE")); } if (parameters.contains("VISIBILITY")) diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/dao/NcUairToRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/dao/NcUairToRecord.java index 6e0b649fb2..af59d91906 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/dao/NcUairToRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/dao/NcUairToRecord.java @@ -14,6 +14,7 @@ * 09/2011 457 S. Gurung Renamed H5 to Nc and h5 to nc * 10/2011 S. Gurung Added changes related to getting stid/lat/lon/elev * from database instead of snstns.xml file + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -24,6 +25,12 @@ package gov.noaa.nws.ncep.common.dataplugin.ncuair.dao; +import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairLiftedIndex; +import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairMaxWind; +import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairObsLevels; +import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairRecord; +import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairTropopause; + import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -34,13 +41,6 @@ import org.apache.commons.logging.LogFactory; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; -import com.raytheon.uf.edex.decodertools.time.TimeTools; - -import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairLiftedIndex; -import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairMaxWind; -import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairObsLevels; -import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairTropopause; -import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairRecord; public class NcUairToRecord { @@ -176,16 +176,13 @@ public class NcUairToRecord { record.setUTC(pdv.getInt("UTC")); } if (parameters.contains("OBSTIME")) { - long vt = pdv.getNumber("OBSTIME").longValue(); - record.setObsTime(TimeTools.newCalendar(vt)); + record.setObsTime(pdv.getCalendar("OBSTIME")); } if (parameters.contains("ISSUETIME")) { - long vt = pdv.getNumber("ISSUETIME").longValue(); - record.setIssueTime(TimeTools.newCalendar(vt)); + record.setIssueTime(pdv.getCalendar("ISSUETIME")); } if (parameters.contains("SYNOPTIME")) { - long vt = pdv.getNumber("SYNOPTIME").longValue(); - record.setSynopticTime(TimeTools.newCalendar(vt)); + record.setSynopticTime(pdv.getCalendar("SYNOPTIME")); } if (parameters.contains("WMOHEADER")) record.setWmoHeader(pdv.getString("WMOHEADER")); @@ -201,8 +198,8 @@ public class NcUairToRecord { SurfaceObsLocation location = new SurfaceObsLocation(); int elev = pdv.getNumber("ELEVATION").intValue(); location.setElevation(elev); - double lat = pdv.getNumber("LATITUDE").doubleValue(); - double lon = pdv.getNumber("LONGITUDE").doubleValue(); + float lat = pdv.getNumber("LATITUDE").floatValue(); + float lon = pdv.getNumber("LONGITUDE").floatValue(); location.assignLocation(lat, lon); String sta = pdv.getString("STATIONID"); location.setStationId(sta); @@ -210,6 +207,7 @@ public class NcUairToRecord { } return record; } + private static NcUairRecord getTTAA(PointDataView pdv, NcUairRecord record) { NcUairObsLevels obslevels; diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.airep/src/gov/noaa/nws/ncep/edex/plugin/airep/AirepDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.airep/src/gov/noaa/nws/ncep/edex/plugin/airep/AirepDecoder.java index 6d06c02168..cb1cfe0774 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.airep/src/gov/noaa/nws/ncep/edex/plugin/airep/AirepDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.airep/src/gov/noaa/nws/ncep/edex/plugin/airep/AirepDecoder.java @@ -44,6 +44,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Sep 05, 2013 2316 bsteffen Unify airep and ncairep. * May 14, 2014 2536 bclement moved WMO Header to common, removed PLUGIN_NAME + * Jul 23, 2014 3410 bclement location changed to floats * * * @author F. J. Yen @@ -143,8 +144,8 @@ public class AirepDecoder extends AbstractDecoder { record.setReportData(parser.getReportData()); location.setStationId(parser.getAircraftId()); record.setReportType(parser.getReportType()); - location.setLatitude(parser.getLatitude()); - location.setLongitude(parser.getLongitude()); + location.setLatitude(parser.getLatitude().floatValue()); + location.setLongitude(parser.getLongitude().floatValue()); location.setFlightLevel(parser.getFlightLevel()); location.setLocation(parser.getLatitude(), parser.getLongitude()); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/util/NcScdParser.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/util/NcScdParser.java index 5ce616a424..5f88329e79 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/util/NcScdParser.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncscd/src/gov/noaa/nws/ncep/edex/plugin/ncscd/util/NcScdParser.java @@ -17,6 +17,7 @@ * Changed type of suspectTimeFlag from Boolean to * String since undefined in PointDataDescription. * 09/2011 457 S. Gurung Renamed H5 to Nc and h5 to nc + * Jul 23, 2014 3410 bclement location changed to floats * * * @author T. Lee @@ -25,6 +26,10 @@ */ package gov.noaa.nws.ncep.edex.plugin.ncscd.util; +import gov.noaa.nws.ncep.common.dataplugin.ncscd.NcScdRecord; +import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; +import gov.noaa.nws.ncep.edex.util.UtilN; + import java.util.Calendar; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -32,13 +37,9 @@ import java.util.regex.Pattern; import com.raytheon.uf.common.pointdata.spatial.ObStation; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.edex.decodertools.time.TimeTools; +import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.edex.pointdata.spatial.ObStationDao; -import gov.noaa.nws.ncep.common.dataplugin.ncscd.NcScdRecord; -import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; -import gov.noaa.nws.ncep.edex.util.UtilN; - public class NcScdParser { /** @@ -96,8 +97,8 @@ public class NcScdParser { if (station != null) { SurfaceObsLocation obsLoc = new SurfaceObsLocation(icao); - Double lat = station.getGeometry().getY(); - Double lon = station.getGeometry().getX(); + float lat = (float) station.getGeometry().getY(); + float lon = (float) station.getGeometry().getX(); obsLoc.assignLocation(lat, lon); obsLoc.setElevation(station.getElevation()); @@ -136,7 +137,7 @@ public class NcScdParser { * i.e., obs time = 240245. */ Calendar issue = record.getIssueTime(); - Calendar obs = TimeTools.copy(issue); + Calendar obs = TimeUtil.newCalendar(issue); int indx; if ( !Character.isDigit(xxx[2].charAt(0)) ) { indx = 3; diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.nctaf/src/gov/noaa/nws/ncep/edex/plugin/nctaf/decoder/NcTafParser.java b/ncep/gov.noaa.nws.ncep.edex.plugin.nctaf/src/gov/noaa/nws/ncep/edex/plugin/nctaf/decoder/NcTafParser.java index 9893ecb63e..c8a7e834fb 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.nctaf/src/gov/noaa/nws/ncep/edex/plugin/nctaf/decoder/NcTafParser.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.nctaf/src/gov/noaa/nws/ncep/edex/plugin/nctaf/decoder/NcTafParser.java @@ -39,7 +39,6 @@ import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.wmo.WMOHeader; -import com.raytheon.uf.edex.decodertools.time.TimeTools; import com.raytheon.uf.edex.pointdata.spatial.ObStationDao; /** @@ -57,6 +56,7 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao; * 10/19/2011 sgurung Modified parseHeader() to use REPORT_HEADER30 * 10/26/2011 sgurung Set tafValidPeriod for each record * May 14, 2014 2536 bclement removed TimeTools usage + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -157,9 +157,9 @@ public class NcTafParser { int currGroup = 0; for (String grp : tafGroups) { - Calendar cStart = TimeTools.copy(validPeriod + Calendar cStart = TimeUtil.newCalendar(validPeriod .getStartDate()); - Calendar cStop = TimeTools.copy(validPeriod + Calendar cStop = TimeUtil.newCalendar(validPeriod .getEndDate()); NcTafPeriod tPeriod = new NcTafPeriod(cStart, cStop); @@ -199,11 +199,11 @@ public class NcTafParser { period1 = group1.getTafChangePeriod(); period2 = group2.getTafChangePeriod(); - period1.setEndDate(TimeTools.copy(period2 + period1.setEndDate(TimeUtil.newCalendar(period2 .getStartDate())); } - period2.setEndDate(TimeTools.copy(validPeriod + period2.setEndDate(TimeUtil.newCalendar(validPeriod .getEndDate())); } record.setChangeGroups(groupSet); @@ -233,8 +233,8 @@ public class NcTafParser { ObStation station = getStationInfo(record.getStationId()); if (station != null) { SurfaceObsLocation obsLoc = new SurfaceObsLocation(record.getStationId()); - Double lat = station.getGeometry().getY(); - Double lon = station.getGeometry().getX(); + float lat = (float) station.getGeometry().getY(); + float lon = (float) station.getGeometry().getX(); obsLoc.assignLocation(lat, lon); obsLoc.setElevation(station.getElevation()); record.setLocation(obsLoc); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairDecoder.java index 001847a6a1..7b7e3a1365 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.ncuair/src/gov/noaa/nws/ncep/edex/plugin/ncuair/decoder/NcUairDecoder.java @@ -16,7 +16,6 @@ import com.raytheon.edex.esb.Headers; import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.plugin.AbstractDecoder; import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.pointdata.spatial.ObStation; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.time.DataTime; @@ -48,6 +47,7 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao; * 11/2011 Q. Zhou Handle multi-record for stationId, eliminate * number-id if there is a non-number-id. * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Jul 23, 2014 3410 bclement location changed to floats * * * This code has been developed by the SIB for use in the AWIPS2 system. @@ -120,7 +120,7 @@ public class NcUairDecoder extends AbstractDecoder { Boolean ship = false; Boolean drop = false; System.out.println("Nc uair decode entered, data size= " + data.length); - long curTime = System.currentTimeMillis(); + // long curTime = System.currentTimeMillis(); if (headers != null) { /* * traceId equals to the file name @@ -196,8 +196,8 @@ public class NcUairDecoder extends AbstractDecoder { SurfaceObsLocation obsLoc = new SurfaceObsLocation( station.getStationId()); if (station.getGeometry() != null) { - Double lat = station.getGeometry().getY(); - Double lon = station.getGeometry().getX(); + float lat = (float) station.getGeometry().getY(); + float lon = (float) station.getGeometry().getX(); obsLoc.assignLocation(lat, lon); Integer elev = station.getElevation(); if (elev == null) { @@ -206,8 +206,8 @@ public class NcUairDecoder extends AbstractDecoder { obsLoc.setElevation(elev); record.setLocation(obsLoc); } else if (station.getUpperAirGeometry() != null) { - Double lat = station.getUpperAirGeometry().getY(); - Double lon = station.getUpperAirGeometry().getX(); + float lat = (float) station.getUpperAirGeometry().getY(); + float lon = (float) station.getUpperAirGeometry().getX(); obsLoc.assignLocation(lat, lon); Integer elev = station.getUpperAirElevation(); if (elev == null) { @@ -316,15 +316,10 @@ public class NcUairDecoder extends AbstractDecoder { * Return the UairRecord record object. */ if (record != null) { - try { - if (headers != null) { - traceId = (String) headers.get("traceId"); - } - record.setTraceId(traceId); - record.constructDataURI(); - } catch (PluginException e) { - throw new DecoderException("Unable to construct dataURI", e); + if (headers != null) { + traceId = (String) headers.get("traceId"); } + record.setTraceId(traceId); } /* @@ -333,8 +328,8 @@ public class NcUairDecoder extends AbstractDecoder { if (record == null) { return new PluginDataObject[0]; } - long enqueueTime = System.currentTimeMillis(); - double latency = (enqueueTime - curTime); + // long enqueueTime = System.currentTimeMillis(); + // double latency = (enqueueTime - curTime); // System.out.println("Nc uair decode spend "+ latency); return new PluginDataObject[] { record }; } @@ -362,10 +357,8 @@ public class NcUairDecoder extends AbstractDecoder { */ NcUairSeparator sep = NcUairSeparator.separate(data, headers); - int i = 0; while (sep.hasNext()) { nil = false; - i++; messageData = sep.next(); // System.out.println("New message # "+ i); @@ -429,8 +422,8 @@ public class NcUairDecoder extends AbstractDecoder { SurfaceObsLocation obsLoc = new SurfaceObsLocation( station.getStationId()); if (station.getGeometry() != null) { - Double lat = station.getGeometry().getY(); - Double lon = station.getGeometry().getX(); + float lat = (float) station.getGeometry().getY(); + float lon = (float) station.getGeometry().getX(); obsLoc.assignLocation(lat, lon); Integer elev = station.getElevation(); if (elev == null) { @@ -439,8 +432,10 @@ public class NcUairDecoder extends AbstractDecoder { obsLoc.setElevation(elev); record.setLocation(obsLoc); } else if (station.getUpperAirGeometry() != null) { - Double lat = station.getUpperAirGeometry().getY(); - Double lon = station.getUpperAirGeometry().getX(); + float lat = (float) station.getUpperAirGeometry() + .getY(); + float lon = (float) station.getUpperAirGeometry() + .getX(); obsLoc.assignLocation(lat, lon); Integer elev = station.getUpperAirElevation(); if (elev == null) { @@ -550,8 +545,8 @@ public class NcUairDecoder extends AbstractDecoder { // set dataTime if (record != null) { if (obsTime != null) { - if (Math.abs(obsTime.getTime().getDate() - - issueTime.getTime().getDate()) >= 2) { + if (Math.abs(obsTime.get(Calendar.DAY_OF_MONTH) + - issueTime.get(Calendar.DAY_OF_MONTH)) >= 2) { // Chin, not a good record, should just skip it System.out.println("Nc uair record bad issue time " + issueTime.getTime().toString() + " obs Time " @@ -571,16 +566,11 @@ public class NcUairDecoder extends AbstractDecoder { * Return the UairRecord record object. */ if (record != null) { - try { - if (headers != null) { - traceId = (String) headers.get("traceId"); - } - record.setTraceId(traceId); - record.constructDataURI(); - recordList.add(record); - } catch (PluginException e) { - throw new DecoderException("Unable to construct dataURI", e); + if (headers != null) { + traceId = (String) headers.get("traceId"); } + record.setTraceId(traceId); + recordList.add(record); } }// end while loop diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/PirepDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/PirepDecoder.java index c95242d894..ffd5b53120 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/PirepDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/PirepDecoder.java @@ -50,6 +50,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Sep 26, 2011 286 qzhou Changed reportType from int to string * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Sep 05, 2013 2316 bsteffen Unify pirep and ncpirep. + * Jul 23, 2014 3410 bclement location changed to floats * * * @author F. J. Yen @@ -164,8 +165,8 @@ public class PirepDecoder extends AbstractDecoder { record.setObsText(DecoderTools.normalizeObs( parser.getReportData(), wmoHeader.getWmoHeader())); - location.setLatitude(p.getLatitude()); - location.setLongitude(p.getLongitude()); + location.setLatitude((float) p.getLatitude()); + location.setLongitude((float) p.getLongitude()); location.setLocation(p.getLatitude(), p.getLongitude()); location.setStationId(parser.getReportingStationId()); diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/decoder/PirepParser.java b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/decoder/PirepParser.java index 64568a9508..41d52ada5c 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/decoder/PirepParser.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.pirep/src/gov/noaa/nws/ncep/edex/plugin/pirep/decoder/PirepParser.java @@ -71,6 +71,7 @@ import com.vividsolutions.jts.geom.Point; * 10/20/2011 472 qzhou Added WX_COND_WORDS. Removed SKY_SKC, SKY_CLR and other _COND_WORDS * 11/01/2011 286 Q.Zhou Added month and year to decodetime * Sep 05, 2013 2316 bsteffen Unify pirep and ncpirep. + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -183,7 +184,8 @@ public class PirepParser { private static final String ICE_REGEX = ICE_TURB_PREFIX + "((?: )(RIME|MXD|CLR))" + ICE_TURB_SUFFIX;//? - private static final String TRB_REGEX = ICE_TURB_PREFIX + "((?: )(CHOP|CAT))?" + ICE_TURB_SUFFIX; + private static final String TRB_REGEX = ICE_TURB_PREFIX + + "((?: )(CHOP|CAT))?" + ICE_TURB_SUFFIX; // 3901N 08446W @@ -712,9 +714,9 @@ public class PirepParser { LatLonPoint point2 = point1.positionOf(-bearing, dist); interLocation = point2; - location = new BasePoint(point2 - .getLatitude(LatLonPoint.INDEGREES), point2 - .getLongitude(LatLonPoint.INDEGREES)); + location = new BasePoint( + point2.getLatitude(LatLonPoint.INDEGREES), + point2.getLongitude(LatLonPoint.INDEGREES)); decodeStatus = true; } else { @@ -851,7 +853,7 @@ public class PirepParser { } } if(lat != null && lon != null) { - point = new BasePoint(lat,lon); + point = new BasePoint(lat, lon); } } } diff --git a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/TafPlotInfoRetriever.java b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/TafPlotInfoRetriever.java index 8fd80a576c..c5f113d8b5 100644 --- a/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/TafPlotInfoRetriever.java +++ b/ncep/gov.noaa.nws.ncep.viz.rsc.plotdata/src/gov/noaa/nws/ncep/viz/rsc/plotdata/rsc/TafPlotInfoRetriever.java @@ -24,6 +24,7 @@ import com.raytheon.viz.pointdata.rsc.retrieve.AbstractDbPlotInfoRetriever; * ------------ ---------- ----------- -------------------------- * 11/03/2011 sgurung Initial creation * 11/16/2011 sgurung Order columns by issue_time and sequenceId desc for correct time matching + * Jul 23, 2014 3410 bclement location changed to floats * * * @@ -69,8 +70,8 @@ public class TafPlotInfoRetriever extends AbstractDbPlotInfoRetriever { protected PlotInfo getPlotInfo(Object[] data) { PlotInfo stationInfo = new PlotInfo(); stationInfo.dataURI = (String) data[0]; - stationInfo.latitude = (Double) data[1]; - stationInfo.longitude = (Double) data[2]; + stationInfo.latitude = ((Number) data[1]).doubleValue(); + stationInfo.longitude = ((Number) data[2]).doubleValue(); stationInfo.stationId = (String) data[3]; if (stationInfo.stationId == null) { stationInfo.stationId = "" + data[1] + "#" + data[2];