From 012e92eda4284bc21817bd49e5fe1dc1471bc49e Mon Sep 17 00:00:00 2001 From: "Qinglu.Lin" Date: Mon, 30 Jun 2014 13:08:49 -0400 Subject: [PATCH] ASM #663 - WarnGen does not properly handle Outer Banks Counties in North Carolina Change-Id: If7fbcea362618e0dea5153f65489388b406b7a81 Former-commit-id: 1d52d020eb81b9db4fc3ad4085850d670bb81bd5 [formerly 1180b318756217e44042c4681d3339ac8b41d6ec [formerly 1200633cd2df86fdb197b74a057e8bfffede8924] [formerly 1d52d020eb81b9db4fc3ad4085850d670bb81bd5 [formerly 4d50beaed59d785d923e357f8ce036f6625ce4b4]]] Former-commit-id: 1180b318756217e44042c4681d3339ac8b41d6ec [formerly 1200633cd2df86fdb197b74a057e8bfffede8924] Former-commit-id: 1180b318756217e44042c4681d3339ac8b41d6ec Former-commit-id: 660d1c9ff275a6b86569b24039ddbbf74a7e2737 --- .../src/com/raytheon/viz/warngen/gis/Area.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java index c91606ecea..e4817f8cbc 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/Area.java @@ -76,6 +76,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry; * Aug 19, 2013 2177 jsanchez Used portionsUtil to calculate area portion descriptions. * Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization. * May 16, 2014 DR 17365 D. Friedman Reduce precision of warning area to avoid topology errors. + * Jun 30, 2014 DR 17447 Qinglu lin Updated findAffectedAreas(). * * * @author chammack @@ -178,6 +179,7 @@ public class Area { } List uniqueFips = new ArrayList(); + List uniqueCountyname = new ArrayList(); List areas = new ArrayList(); for (GeospatialData regionFeature : countyMap.values()) { Geometry regionGeom = regionFeature.geometry; @@ -257,8 +259,12 @@ public class Area { area.points = pointList.toArray(new String[pointList.size()]); } - if (uniqueFips.contains(area.fips) == false) { + String countyName = (String)regionFeature.attributes.get("COUNTYNAME"); + if (uniqueFips.contains(area.fips) == false || !uniqueCountyname.contains(countyName)) { uniqueFips.add(area.fips); + if (countyName != null) { + uniqueCountyname.add(countyName); + } areas.add(area); } }