ASM #15627 - WarnGen leaving out reference to State that is under SVR or TOR Watch in SPS text products.
Change-Id: Ic5689db7714be086d6e4543602db33a07e5b2fc1 Former-commit-id:c71189dd92
[formerlye24dd6958e
] [formerlyba4c386f30
] [formerlyc71189dd92
[formerlye24dd6958e
] [formerlyba4c386f30
] [formerly8cffe955a9
[formerlyba4c386f30
[formerly 00ec5e2d47809d084b3e24e1f1503af96d129fed]]]] Former-commit-id:8cffe955a9
Former-commit-id:4c4132f0aa
[formerlyf186b49e92
] [formerly ff7f89fdff34c0527901d834458ee4e10d6f19f3 [formerlybb7b43be49
]] Former-commit-id: 6829c833cd21836bdce90d24a801642877a0b282 [formerly134b1286fc
] Former-commit-id:cc3172ead3
This commit is contained in:
parent
7f7869a810
commit
b280c3f5c7
3 changed files with 113 additions and 22 deletions
|
@ -212,6 +212,7 @@ import com.vividsolutions.jts.io.WKTReader;
|
||||||
* 07/01/2014 DR 17450 D. Friedman Use list of templates from backup site.
|
* 07/01/2014 DR 17450 D. Friedman Use list of templates from backup site.
|
||||||
* 07/28/2014 DR 17475 Qinglu Lin Updated populateStrings() and findLargestQuadrant(), removed findLargestGeometry(),
|
* 07/28/2014 DR 17475 Qinglu Lin Updated populateStrings() and findLargestQuadrant(), removed findLargestGeometry(),
|
||||||
* added createAreaAndCentroidMaps() and movePopulatePt(), updated paintText() to center W.
|
* added createAreaAndCentroidMaps() and movePopulatePt(), updated paintText() to center W.
|
||||||
|
* 07/28/2014 DR15627 mgamazaychikov Change access qualifiers for some fields, methods for GeospatialDataList and GeospatialDataAccessor classes, create setAccessorAreaSourceConfiguration method.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author mschenke
|
* @author mschenke
|
||||||
|
@ -246,10 +247,22 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
GeneralGridGeometry localGridGeometry;
|
GeneralGridGeometry localGridGeometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class GeospatialDataAccessor {
|
public static class GeospatialDataAccessor {
|
||||||
GeospatialDataList geoData;
|
public GeospatialDataList geoData;
|
||||||
|
|
||||||
AreaSourceConfiguration areaConfig;
|
public AreaSourceConfiguration areaConfig;
|
||||||
|
|
||||||
|
public GeospatialDataList getGeoData() {
|
||||||
|
return geoData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AreaSourceConfiguration getAreaConfig() {
|
||||||
|
return areaConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GeospatialData[] getFeatures() {
|
||||||
|
return Arrays.copyOf(geoData.features, geoData.features.length);
|
||||||
|
}
|
||||||
|
|
||||||
public GeospatialDataAccessor(GeospatialDataList geoData,
|
public GeospatialDataAccessor(GeospatialDataList geoData,
|
||||||
AreaSourceConfiguration areaConfig) {
|
AreaSourceConfiguration areaConfig) {
|
||||||
|
@ -1550,7 +1563,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
return ugcs;
|
return ugcs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GeospatialDataAccessor getGeospatialDataAcessor()
|
public GeospatialDataAccessor getGeospatialDataAcessor()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
GeospatialDataList gdl = searchGeospatialDataAccessor();
|
GeospatialDataList gdl = searchGeospatialDataAccessor();
|
||||||
if (gdl == null) {
|
if (gdl == null) {
|
||||||
|
@ -1571,12 +1584,36 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
// TODO: There should be some way to get the "county" configuration by
|
// TODO: There should be some way to get the "county" configuration by
|
||||||
// name
|
// name
|
||||||
// independent of a template
|
// independent of a template
|
||||||
AreaSourceConfiguration areaConfig = new AreaSourceConfiguration();
|
AreaSourceConfiguration areaConfig = getAccessorAreaSourceConfiguration();
|
||||||
areaConfig.setFipsField("FIPS");
|
|
||||||
|
|
||||||
return new GeospatialDataAccessor(gdl, areaConfig);
|
return new GeospatialDataAccessor(gdl, areaConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String ASC_MARINE = "MarineZones";
|
||||||
|
private static String ASC_COUNTY = "County";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the AreaSourceConfiguration for either county or marine zones based product
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private AreaSourceConfiguration getAccessorAreaSourceConfiguration() throws Exception {
|
||||||
|
boolean isMarineZone = configuration.getGeospatialConfig()
|
||||||
|
.getAreaSource().equalsIgnoreCase(MARINE);
|
||||||
|
WarngenConfiguration ascConfig = WarngenConfiguration.loadConfig(
|
||||||
|
"watchAreaSourceConfiguration", getLocalizedSite(), null);
|
||||||
|
AreaSourceConfiguration[] areaConfigs = ascConfig.getAreaSources();
|
||||||
|
for (AreaSourceConfiguration af:areaConfigs){
|
||||||
|
if (!isMarineZone && af.getAreaSource().equalsIgnoreCase(ASC_COUNTY)) {;
|
||||||
|
return af;
|
||||||
|
}
|
||||||
|
else if (isMarineZone && af.getAreaSource().equalsIgnoreCase(ASC_MARINE) ) {
|
||||||
|
return af;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new AreaSourceConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
private GeospatialDataList searchGeospatialDataAccessor() {
|
private GeospatialDataList searchGeospatialDataAccessor() {
|
||||||
synchronized (siteMap) {
|
synchronized (siteMap) {
|
||||||
for (Map.Entry<String, GeospatialDataList> entry : siteMap
|
for (Map.Entry<String, GeospatialDataList> entry : siteMap
|
||||||
|
|
|
@ -63,7 +63,6 @@ import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
|
||||||
import com.raytheon.uf.common.dataplugin.warning.WarningConstants;
|
import com.raytheon.uf.common.dataplugin.warning.WarningConstants;
|
||||||
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
|
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
|
||||||
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration;
|
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration;
|
||||||
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType;
|
|
||||||
import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
|
import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
|
||||||
import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData;
|
import com.raytheon.uf.common.dataplugin.warning.gis.GeospatialData;
|
||||||
import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil;
|
import com.raytheon.uf.common.dataplugin.warning.util.GeometryUtil;
|
||||||
|
@ -103,6 +102,7 @@ import com.raytheon.viz.warngen.gis.Wx;
|
||||||
import com.raytheon.viz.warngen.gui.BackupData;
|
import com.raytheon.viz.warngen.gui.BackupData;
|
||||||
import com.raytheon.viz.warngen.gui.FollowupData;
|
import com.raytheon.viz.warngen.gui.FollowupData;
|
||||||
import com.raytheon.viz.warngen.gui.WarngenLayer;
|
import com.raytheon.viz.warngen.gui.WarngenLayer;
|
||||||
|
import com.raytheon.viz.warngen.gui.WarngenLayer.GeospatialDataAccessor;
|
||||||
import com.raytheon.viz.warngen.gui.WarngenUIState;
|
import com.raytheon.viz.warngen.gui.WarngenUIState;
|
||||||
import com.raytheon.viz.warngen.text.WarningTextHandler;
|
import com.raytheon.viz.warngen.text.WarningTextHandler;
|
||||||
import com.raytheon.viz.warngen.text.WarningTextHandlerFactory;
|
import com.raytheon.viz.warngen.text.WarningTextHandlerFactory;
|
||||||
|
@ -159,6 +159,8 @@ import com.vividsolutions.jts.io.WKTReader;
|
||||||
* Apr 28, 2014 3033 jsanchez Set the site and backup site in Velocity Engine's properties
|
* Apr 28, 2014 3033 jsanchez Set the site and backup site in Velocity Engine's properties
|
||||||
* Mar 17, 2014 DR 16309 Qinglu Lin Updated getWatches(), processATEntries() and determineAffectedPortions(), and
|
* Mar 17, 2014 DR 16309 Qinglu Lin Updated getWatches(), processATEntries() and determineAffectedPortions(), and
|
||||||
* added determineAffectedMarinePortions().
|
* added determineAffectedMarinePortions().
|
||||||
|
* Jul 17, 2014 DR15627 mgamazaychikov Fix setting asc and geoData in processATEntries, update getStateName,
|
||||||
|
* determineAffectedPortions and determineAffectedMarinePortions.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author njensen
|
* @author njensen
|
||||||
|
@ -1153,14 +1155,14 @@ public class TemplateRunner {
|
||||||
Set<String> validUgcZones) {
|
Set<String> validUgcZones) {
|
||||||
WatchUtil rval = new WatchUtil();
|
WatchUtil rval = new WatchUtil();
|
||||||
TreeMap<WeatherAdvisoryWatch, WatchWork> map = new TreeMap<WeatherAdvisoryWatch, TemplateRunner.WatchWork>();
|
TreeMap<WeatherAdvisoryWatch, WatchWork> map = new TreeMap<WeatherAdvisoryWatch, TemplateRunner.WatchWork>();
|
||||||
|
GeospatialData[] geoData = null;
|
||||||
AreaSourceConfiguration asc = null;
|
AreaSourceConfiguration asc = null;
|
||||||
for (AreaSourceConfiguration a : warngenLayer.getConfiguration()
|
try {
|
||||||
.getAreaSources()) {
|
GeospatialDataAccessor gda = warngenLayer.getGeospatialDataAcessor();
|
||||||
if (a.getType() == AreaType.HATCHING) {
|
geoData = gda.getFeatures();
|
||||||
asc = a;
|
asc = gda.getAreaConfig();
|
||||||
break;
|
} catch (Exception e) {
|
||||||
}
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),e);
|
||||||
}
|
}
|
||||||
if (asc == null) {
|
if (asc == null) {
|
||||||
statusHandler
|
statusHandler
|
||||||
|
@ -1168,8 +1170,6 @@ public class TemplateRunner {
|
||||||
"Cannot process watches: missing HATCHING area source configuration");
|
"Cannot process watches: missing HATCHING area source configuration");
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
GeospatialData[] geoData = warngenLayer.getGeodataFeatures(
|
|
||||||
asc.getAreaSource(), warngenLayer.getLocalizedSite());
|
|
||||||
if ((geoData == null) || (geoData.length == 0)) {
|
if ((geoData == null) || (geoData.length == 0)) {
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(Priority.ERROR,
|
||||||
"Cannot process watches: cannot get geospatial data");
|
"Cannot process watches: cannot get geospatial data");
|
||||||
|
@ -1232,7 +1232,7 @@ public class TemplateRunner {
|
||||||
rval.addWaw(work.waw);
|
rval.addWaw(work.waw);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (determineAffectedMarinePortions(work.ugcZone, asc, geoData, work.waw)) {
|
if (determineAffectedMarinePortions(work.ugcZone, geoData, work.waw)) {
|
||||||
rval.addWaw(work.waw);
|
rval.addWaw(work.waw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1297,7 +1297,7 @@ public class TemplateRunner {
|
||||||
for (Entry<String, Set<String>> e : map.entrySet()) {
|
for (Entry<String, Set<String>> e : map.entrySet()) {
|
||||||
Portion portion = new Portion();
|
Portion portion = new Portion();
|
||||||
try {
|
try {
|
||||||
portion.parentRegion = getStateName(e.getKey(), asc, geoData)
|
portion.parentRegion = getStateName(e.getKey(), geoData)
|
||||||
.toUpperCase();
|
.toUpperCase();
|
||||||
} catch (RuntimeException exc) {
|
} catch (RuntimeException exc) {
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(Priority.ERROR,
|
||||||
|
@ -1330,8 +1330,7 @@ public class TemplateRunner {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private static boolean determineAffectedMarinePortions(List<String> ugcs,
|
private static boolean determineAffectedMarinePortions(List<String> ugcs,
|
||||||
AreaSourceConfiguration asc, GeospatialData[] geoData,
|
GeospatialData[] geoData, WeatherAdvisoryWatch waw) {
|
||||||
WeatherAdvisoryWatch waw) {
|
|
||||||
|
|
||||||
// Maps state abbreviation to unique fe_area values
|
// Maps state abbreviation to unique fe_area values
|
||||||
HashMap<String, Set<String>> map = new HashMap<String, Set<String>>();
|
HashMap<String, Set<String>> map = new HashMap<String, Set<String>>();
|
||||||
|
@ -1510,7 +1509,7 @@ public class TemplateRunner {
|
||||||
return abrev;
|
return abrev;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getStateName(String key, AreaSourceConfiguration asc,
|
private static String getStateName(String key,
|
||||||
GeospatialData[] geoData) {
|
GeospatialData[] geoData) {
|
||||||
for (GeospatialData g : geoData) {
|
for (GeospatialData g : geoData) {
|
||||||
if (key.equals(g.attributes.get("STATE"))) {
|
if (key.equals(g.attributes.get("STATE"))) {
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
<!-- Area Source Configuration for products that include watches -->
|
||||||
|
<!-- MODIFIED
|
||||||
|
MIKE GAMAZAYCHIKOV 7-25-2014
|
||||||
|
-->
|
||||||
|
|
||||||
|
<warngenConfig>
|
||||||
|
<!-- CREATE PRIMARY areaSource OBJECT TO GENERATE COUNTY-BASED INFORMATION OFF WARNGEN HATCHING -->
|
||||||
|
<areaSource variable="counties">
|
||||||
|
<areaSource>County</areaSource>
|
||||||
|
<inclusionPercent>0</inclusionPercent>
|
||||||
|
<inclusionAndOr>AND</inclusionAndOr>
|
||||||
|
<inclusionArea>0</inclusionArea>
|
||||||
|
<areaField>COUNTYNAME</areaField>
|
||||||
|
<parentAreaField>NAME</parentAreaField>
|
||||||
|
<areaNotationField>STATE</areaNotationField>
|
||||||
|
<feAreaField>FE_AREA</feAreaField>
|
||||||
|
<timeZoneField>TIME_ZONE</timeZoneField>
|
||||||
|
<areaNotationTranslationFile>countyTypes.txt</areaNotationTranslationFile>
|
||||||
|
<fipsField>FIPS</fipsField>
|
||||||
|
<pointField>NAME</pointField>
|
||||||
|
<sortBy>
|
||||||
|
<sort>parent</sort>
|
||||||
|
</sortBy>
|
||||||
|
<pointFilter>
|
||||||
|
<mapping key="WARNGENLEV">
|
||||||
|
<constraint constraintValue="1" constraintType="EQUALS" />
|
||||||
|
</mapping>
|
||||||
|
</pointFilter>
|
||||||
|
<includedWatchAreaBuffer>0</includedWatchAreaBuffer>
|
||||||
|
</areaSource>
|
||||||
|
|
||||||
|
<!-- CREATE areaSource OBJECT TO GENERATE MARINE-BASED INFORMATION OFF WARNGEN HATCHING -->
|
||||||
|
<areaSource variable="marineZones">
|
||||||
|
<areaSource>MarineZones</areaSource>
|
||||||
|
<inclusionPercent>0</inclusionPercent>
|
||||||
|
<inclusionAndOr>AND</inclusionAndOr>
|
||||||
|
<inclusionArea>0</inclusionArea>
|
||||||
|
<areaField>NAME</areaField>
|
||||||
|
<parentAreaField>NAME</parentAreaField>
|
||||||
|
<areaNotationField>NAME</areaNotationField>
|
||||||
|
<areaNotationTranslationFile>countyTypes.txt</areaNotationTranslationFile>
|
||||||
|
<fipsField>ID</fipsField>
|
||||||
|
<pointField>NAME</pointField>
|
||||||
|
<sortBy>
|
||||||
|
<sort>parent</sort>
|
||||||
|
</sortBy>
|
||||||
|
<pointFilter>
|
||||||
|
<mapping key="WARNGENLEV">
|
||||||
|
<constraint constraintValue="1" constraintType="EQUALS" />
|
||||||
|
</mapping>
|
||||||
|
</pointFilter>
|
||||||
|
<includedWatchAreaBuffer>0</includedWatchAreaBuffer>
|
||||||
|
</areaSource>
|
||||||
|
</warngenConfig>
|
||||||
|
|
Loading…
Add table
Reference in a new issue