ASM #18154 - assigning 1 to usedirs in warngenloc table results in incorrect third bullet in a SVR product

Change-Id: I121d2610ea72f9afdd21bb2fb790e26c5aeb1b4d

Former-commit-id: b5534ca240aa8931ac0f09d945b1d99f307ff982
This commit is contained in:
Qinglu.Lin 2015-10-09 08:53:35 -04:00
parent 4a5cc197fc
commit bae2c8d0b6

View file

@ -60,6 +60,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* for county based products.
* Jan 13, 2015 3996 ccody Correct NPE caused by calculating portions of Geometry objects with multiple sub Geometry objects
* This is a Jim Ramer fix
* Oct 9, 2015 #18154 Qinglu Lin Updated calculateLocationPortion().
* </pre>
*
* @author chammack
@ -353,12 +354,6 @@ public class GisUtil {
public static EnumSet<Direction> calculateLocationPortion(
Geometry locationGeom, Geometry reference, boolean useExtreme,
boolean notUseShapefileCentroid) {
CountyUserData cud = (CountyUserData) locationGeom.getUserData();
Map<String, Object> atts = cud.entry.attributes;
Number lonNumber = (Number) atts.get("LON");
double lonDouble = lonNumber.doubleValue();
Number latNumber = (Number) atts.get("LAT");
double latDouble = latNumber.doubleValue();
for (int i = 0; i < locationGeom.getNumGeometries(); i++) {
Geometry geom = locationGeom.getGeometryN(i);
if (geom.intersects(reference)) {
@ -368,9 +363,10 @@ public class GisUtil {
geomCentroid = geom.getEnvelope().getCentroid()
.getCoordinate();
} else {
Map<String, Object> atts = ((CountyUserData) locationGeom.getUserData()).entry.attributes;
geomCentroid = new Coordinate();
geomCentroid.x = lonDouble;
geomCentroid.y = latDouble;
geomCentroid.x = ((Number) atts.get("LON")).doubleValue();
geomCentroid.y = ((Number) atts.get("LAT")).doubleValue();
}
Coordinate refCentroid = reference.getCentroid()
.getCoordinate();