Omaha #3477 changed plot info locations to floats

Change-Id: I592ba9d4b514aaed8902f3e8fba33b58200e1c61

Former-commit-id: 00504d6aa7fefd7b6d28701aae777c0fb7d5ace5
This commit is contained in:
Brian Clements 2014-08-08 13:20:35 -05:00
parent fed30c111e
commit f8a1e79288
10 changed files with 45 additions and 39 deletions

View file

@ -27,8 +27,8 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.common.time.DataTime;
@ -50,6 +50,7 @@ import com.raytheon.viz.pointdata.rsc.retrieve.AbstractPlotInfoRetriever;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2009 bsteffen Initial creation
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*
* </pre>
*
@ -75,9 +76,8 @@ public class CoopPrecipPlotInfoRetriever extends AbstractPlotInfoRetriever {
for (int uriCounter = 0; uriCounter < pdc.getCurrentSz(); uriCounter++) {
PointDataView pdv = pdc.readRandom(uriCounter);
PlotInfo stationInfo = new PlotInfo();
stationInfo.latitude = pdv.getNumber("latitude").doubleValue();
stationInfo.longitude = pdv.getNumber("longitude")
.doubleValue();
stationInfo.latitude = pdv.getNumber("latitude").floatValue();
stationInfo.longitude = pdv.getNumber("longitude").floatValue();
stationInfo.dataTime = new DataTime(new Time(
pdv.getLong("time")));
stationInfo.stationId = pdv.getString("stationId");

View file

@ -38,6 +38,7 @@ import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
* ------------ ---------- ----------- --------------------------
* Sep 15, 2009 mschenke Initial creation
* Jul 23, 2014 3410 bclement location changed to floats
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*
* </pre>
*
@ -52,10 +53,10 @@ public class PlotAlertParser extends AbstractAlertMessageParser {
AbstractRequestableResourceData resourceData) throws VizException {
String stationId = (String) message.decodedAlert
.get("location.stationId");
Double lat = ((Number) message.decodedAlert.get("location.latitude"))
.doubleValue();
Double lon = ((Number) message.decodedAlert.get("location.longitude"))
.doubleValue();
Float lat = ((Number) message.decodedAlert.get("location.latitude"))
.floatValue();
Float lon = ((Number) message.decodedAlert.get("location.longitude"))
.floatValue();
DataTime dataTime = (DataTime) message.decodedAlert.get("dataTime");
return new PlotInfo(stationId, lat, lon, dataTime,
message.dataURI);

View file

@ -30,6 +30,7 @@ import com.raytheon.uf.common.time.DataTime;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 15, 2009 mschenke Initial creation
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*
* </pre>
*
@ -41,9 +42,9 @@ public class PlotInfo {
public String stationId;
public Double latitude;
public Float latitude;
public Double longitude;
public Float longitude;
public DataTime dataTime;
@ -66,8 +67,8 @@ public class PlotInfo {
}
public PlotInfo(String stationId, Double latitude,
Double longitude, DataTime dataTime, String dataURI) {
public PlotInfo(String stationId, Float latitude, Float longitude,
DataTime dataTime, String dataURI) {
this.stationId = stationId;
this.latitude = latitude;
this.longitude = longitude;

View file

@ -15,8 +15,8 @@ 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.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -40,6 +40,7 @@ import com.raytheon.viz.pointdata.PlotInfo;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 12, 2011 bsteffen Initial creation
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*
* </pre>
*
@ -121,8 +122,8 @@ public class FullDataPlotInfoRetriever extends AbstractPlotInfoRetriever {
if (stationId != null) {
info.stationId = pdv.getString(stationId);
}
info.latitude = pdv.getNumber(latitude).doubleValue();
info.longitude = pdv.getNumber(longitude).doubleValue();
info.latitude = pdv.getNumber(latitude).floatValue();
info.longitude = pdv.getNumber(longitude).floatValue();
info.dataURI = pdv.getString("dataURI");
Date vTime = new Date(pdv.getLong(validTime));
if (fcstTime != null) {

View file

@ -51,6 +51,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
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*
* </pre>
*
@ -88,8 +89,8 @@ public class PointDataPlotInfoRetriever extends AbstractDbPlotInfoRetriever {
@Override
protected PlotInfo getPlotInfo(Object[] data) {
PlotInfo stationInfo = new PlotInfo();
stationInfo.latitude = ((Number) data[0]).doubleValue();
stationInfo.longitude = ((Number) data[1]).doubleValue();
stationInfo.latitude = ((Number) data[0]).floatValue();
stationInfo.longitude = ((Number) data[1]).floatValue();
stationInfo.stationId = (String) data[2];
if (stationInfo.stationId == null) {
stationInfo.stationId = "" + stationInfo.latitude + "#"

View file

@ -37,6 +37,7 @@ import com.raytheon.viz.pointdata.rsc.retrieve.AbstractDbPlotInfoRetriever;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 9, 2009 bsteffen Initial creation
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*
* </pre>
*
@ -58,8 +59,8 @@ public class RadarPlotInfoRetriever extends AbstractDbPlotInfoRetriever {
@Override
protected PlotInfo getPlotInfo(Object[] data) {
PlotInfo stationInfo = new PlotInfo();
stationInfo.latitude = ((Float) data[0]).doubleValue();
stationInfo.longitude = ((Float) data[1]).doubleValue();
stationInfo.latitude = ((Number) data[0]).floatValue();
stationInfo.longitude = ((Number) data[1]).floatValue();
stationInfo.stationId = (String) data[2];
if (stationInfo.stationId == null) {
stationInfo.stationId = "" + data[0] + "#" + data[1];

View file

@ -72,6 +72,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* 05/20/2013 988 Archana.S Initial creation.
* 02/26/2014 1061 B. Hebbard Relax tolerance for extent/zoom compare to avoid infinite loop.
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*/
public class NcPlotImageCreator {
@ -892,7 +893,7 @@ public class NcPlotImageCreator {
* @param lon
* @return
*/
private String createStationMapKey(Double lon, Double lat) {
private String createStationMapKey(Float lon, Float lat) {
return new String("" + Math.round(lon * 1000.0) + ","
+ Math.round(lat * 1000.0));

View file

@ -130,6 +130,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* 05/20/2013 988 Archana.S Refactored this class for performance improvement
* 11/07/2013 sgurung Added fix for "no data for every other frame" issue (earlier fix was added to 13.5.2 on 10/24/2013)
* 03/18/2013 1064 B. Hebbard Added handling of matrixType request constraint, for PAFM
* Aug 08, 2014 3477 bclement changed plot info locations to floats
* </pre>
*
* @author brockwoo
@ -264,8 +265,8 @@ public class NcPlotResource2 extends
synchronized (stationList) {
for (Station station : stationList) {
String stnKey = getStationMapKey(
station.info.latitude.doubleValue(),
station.info.longitude.doubleValue());
station.info.latitude,
station.info.longitude);
if (trialKey == null)
trialKey = new String(stnKey);
@ -519,10 +520,8 @@ public class NcPlotResource2 extends
* stored in the database with missing/invalid lat/lon values
*/
if (plotInfo.latitude.doubleValue() < -90
|| plotInfo.latitude.doubleValue() > 90
|| plotInfo.longitude.doubleValue() < -180
|| plotInfo.longitude.doubleValue() > 180) {
if (plotInfo.latitude < -90 || plotInfo.latitude > 90
|| plotInfo.longitude < -180 || plotInfo.longitude > 180) {
return false;
}
@ -547,8 +546,8 @@ public class NcPlotResource2 extends
out.println("2 stations " + stn.info.stationId
+ " and " + plotInfo.stationId
+ " have the same location?" + "\nLat = "
+ stn.info.latitude.doubleValue() + ",Lon = "
+ stn.info.longitude.doubleValue()
+ stn.info.latitude + ",Lon = "
+ stn.info.longitude
+ " for the time: " + stn.info.dataTime);
}
// if these are the same time, should we check which one
@ -1612,8 +1611,8 @@ public class NcPlotResource2 extends
fd.setOfStationsLastRendered.addAll(collectionOfStationsToBeRendered);
for (Station stn : collectionOfStationsToBeRendered) {
String stnKey = getStationMapKey(stn.info.latitude.doubleValue(),
stn.info.longitude.doubleValue());
String stnKey = getStationMapKey(stn.info.latitude,
stn.info.longitude);
synchronized (fd.stationMap) {
fd.stationMap.put(stnKey, stn);
}
@ -1689,7 +1688,7 @@ public class NcPlotResource2 extends
// generate a string used as the key for the StationMap
private String getStationMapKey(Double lat, Double lon) {
private String getStationMapKey(Float lat, Float lon) {
return new String("" + Math.round(lat * 1000.0) + ","
+ Math.round(lon * 1000.0));
}

View file

@ -20,11 +20,13 @@
package gov.noaa.nws.ncep.viz.rsc.plotdata.rsc;
import static java.lang.System.out;
import gov.noaa.nws.ncep.gempak.parameters.core.marshaller.garea.GraphicsAreaCoordinates;
import gov.noaa.nws.ncep.viz.common.preferences.GraphicsAreaPreferences;
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsResource;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResource;
import gov.noaa.nws.ncep.viz.resources.manager.ResourceName;
import gov.noaa.nws.ncep.viz.common.preferences.GraphicsAreaPreferences;
import gov.noaa.nws.ncep.viz.common.ui.NmapCommon;
import gov.noaa.nws.ncep.viz.rsc.plotdata.plotModels.PlotModelGenerator2;
import gov.noaa.nws.ncep.viz.rsc.plotdata.plotModels.StaticPlotInfoPV;
import gov.noaa.nws.ncep.viz.rsc.plotdata.plotModels.StaticPlotInfoPV.SPIEntry;
@ -64,7 +66,6 @@ import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.viz.pointdata.IPlotModelGeneratorCaller;
@ -72,9 +73,7 @@ import com.raytheon.viz.pointdata.PlotAlertParser;
import com.raytheon.viz.pointdata.PlotInfo;
import com.raytheon.viz.pointdata.rsc.retrieve.PointDataPlotInfoRetriever;
import com.vividsolutions.jts.geom.Coordinate;
import gov.noaa.nws.ncep.gempak.parameters.core.marshaller.garea.GraphicsAreaCoordinates;
import static java.lang.System.out;
/**
* Provides a resource that will display plot data for a given reference time.
*
@ -118,6 +117,7 @@ import static java.lang.System.out;
* (this fixes the issue of slow performance when zooming all the way in, when Data Area is set)
* 11/04/2012 #944 ghull add query for Fcst Plot resources
* Jun 25, 2013 1869 bsteffen Fix plot sampling.
* Aug 08, 2014 3477 bclement changed plot info locations to floats
* </pre>
*
* @author brockwoo
@ -1090,7 +1090,7 @@ public class PlotResource2 extends AbstractNatlCntrsResource<PlotResourceData, N
// generate a string used as the key for the StationMap
//
private String getStationMapKey( Double lat, Double lon ) {
private String getStationMapKey(Float lat, Float lon) {
return new String( ""+Math.round(lat*1000.0) + ","+
Math.round(lon*1000.0) );

View file

@ -25,6 +25,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
* Aug 08, 2014 3477 bclement changed plot info locations to floats
*
* </pre>
*
@ -70,8 +71,8 @@ public class TafPlotInfoRetriever extends AbstractDbPlotInfoRetriever {
protected PlotInfo getPlotInfo(Object[] data) {
PlotInfo stationInfo = new PlotInfo();
stationInfo.dataURI = (String) data[0];
stationInfo.latitude = ((Number) data[1]).doubleValue();
stationInfo.longitude = ((Number) data[2]).doubleValue();
stationInfo.latitude = ((Number) data[1]).floatValue();
stationInfo.longitude = ((Number) data[2]).floatValue();
stationInfo.stationId = (String) data[3];
if (stationInfo.stationId == null) {
stationInfo.stationId = "" + data[1] + "#" + data[2];