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