ASM #18746 - Cherry-pick Omaha #5217 from 16.1.2-p to 16.2.1

Calculated interior longitudes are now always > 0.

Change-Id: I408eb04aa8ca344910a5e3d7773dbb0cb7277902
(cherry picked from commit b6eaf35398bf6126d7ee8ca140cd05880504a184)
(cherry picked from commit 6c8d7863e8d9dc8df3c983ec0de657c9fdc2a13d [formerly 85832fb048cc36b8d3baa66595585b906d686fdc])

Former-commit-id: 5c77638d0e2ef792a66e86cddfafb5a626450f46
This commit is contained in:
Mike Duff 2016-03-23 08:55:36 -05:00 committed by Shawn.Hooper
parent 2f549c147a
commit b475dd13af

View file

@ -44,6 +44,7 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
* Sep 12, 2009 2772 mpduff Initial creation
* 30 June 2015 17360 xwei Fixed : basins.dat import failed if the first line does not have Lat Lon
* Aug 18, 2015 4763 rjpeter Use Number in blind cast.
* Mar 22, 2016 5217 mduff Must ensure longitude values are > 0.
* </pre>
*
* @author mpduff
@ -53,6 +54,7 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
public class GeoDataManager extends HydroDataManager {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GeoDataManager.class);
private static GeoDataManager instance = null;
private GeoDataManager() {
@ -196,8 +198,9 @@ public class GeoDataManager extends HydroDataManager {
lonTotal += posWeight * lon[i];
}
// In Hydro Longitude must be > 0
intLon = Math.abs(lonTotal / weightTotal);
intLat = latTotal / weightTotal;
intLon = lonTotal / weightTotal;
data.setInteriorLat(intLat);
data.setInteriorLon(intLon);