ASM #15627 Revert "ASM #15627 - WarnGen leaving out reference to State that is under SVR or TOR Watch in SPS text products."
This reverts commit 9732ea69398c323fee2b61570bfc18ab595da709 [formerly8cffe955a9
] [formerlye24dd6958e
[formerlyba4c386f30
] [formerlye24dd6958e
[formerlyba4c386f30
] [formerly8cffe955a9
[formerly 00ec5e2d47809d084b3e24e1f1503af96d129fed]]]]. Change-Id: Ie01ca9463a4db371ffce0b6e38d5c43e1f9addf2 Former-commit-id:27f50397aa
[formerly976c7b2d4a
] [formerly27f50397aa
[formerly976c7b2d4a
] [formerly4e322737ce
[formerly d272d426f8bd218954a75a7b2e19d21b30f975cb]]] Former-commit-id:4e322737ce
Former-commit-id:af19d9f9c4
[formerlyfe0fffe51b
] Former-commit-id:17ac974932
This commit is contained in:
parent
e044393934
commit
53daf4e3bc
3 changed files with 22 additions and 113 deletions
|
@ -212,7 +212,6 @@ import com.vividsolutions.jts.io.WKTReader;
|
|||
* 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(),
|
||||
* 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>
|
||||
*
|
||||
* @author mschenke
|
||||
|
@ -247,22 +246,10 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
|||
GeneralGridGeometry localGridGeometry;
|
||||
}
|
||||
|
||||
public static class GeospatialDataAccessor {
|
||||
public GeospatialDataList geoData;
|
||||
private static class GeospatialDataAccessor {
|
||||
GeospatialDataList geoData;
|
||||
|
||||
public AreaSourceConfiguration areaConfig;
|
||||
|
||||
public GeospatialDataList getGeoData() {
|
||||
return geoData;
|
||||
}
|
||||
|
||||
public AreaSourceConfiguration getAreaConfig() {
|
||||
return areaConfig;
|
||||
}
|
||||
|
||||
public GeospatialData[] getFeatures() {
|
||||
return Arrays.copyOf(geoData.features, geoData.features.length);
|
||||
}
|
||||
AreaSourceConfiguration areaConfig;
|
||||
|
||||
public GeospatialDataAccessor(GeospatialDataList geoData,
|
||||
AreaSourceConfiguration areaConfig) {
|
||||
|
@ -1563,7 +1550,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
|||
return ugcs;
|
||||
}
|
||||
|
||||
public GeospatialDataAccessor getGeospatialDataAcessor()
|
||||
private GeospatialDataAccessor getGeospatialDataAcessor()
|
||||
throws Exception {
|
||||
GeospatialDataList gdl = searchGeospatialDataAccessor();
|
||||
if (gdl == null) {
|
||||
|
@ -1584,36 +1571,12 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
|||
// TODO: There should be some way to get the "county" configuration by
|
||||
// name
|
||||
// independent of a template
|
||||
AreaSourceConfiguration areaConfig = getAccessorAreaSourceConfiguration();
|
||||
AreaSourceConfiguration areaConfig = new AreaSourceConfiguration();
|
||||
areaConfig.setFipsField("FIPS");
|
||||
|
||||
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() {
|
||||
synchronized (siteMap) {
|
||||
for (Map.Entry<String, GeospatialDataList> entry : siteMap
|
||||
|
|
|
@ -63,6 +63,7 @@ import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
|
|||
import com.raytheon.uf.common.dataplugin.warning.WarningConstants;
|
||||
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.AreaType;
|
||||
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.util.GeometryUtil;
|
||||
|
@ -102,7 +103,6 @@ import com.raytheon.viz.warngen.gis.Wx;
|
|||
import com.raytheon.viz.warngen.gui.BackupData;
|
||||
import com.raytheon.viz.warngen.gui.FollowupData;
|
||||
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.text.WarningTextHandler;
|
||||
import com.raytheon.viz.warngen.text.WarningTextHandlerFactory;
|
||||
|
@ -159,8 +159,6 @@ import com.vividsolutions.jts.io.WKTReader;
|
|||
* 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
|
||||
* added determineAffectedMarinePortions().
|
||||
* Jul 17, 2014 DR15627 mgamazaychikov Fix setting asc and geoData in processATEntries, update getStateName,
|
||||
* determineAffectedPortions and determineAffectedMarinePortions.
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -1155,14 +1153,14 @@ public class TemplateRunner {
|
|||
Set<String> validUgcZones) {
|
||||
WatchUtil rval = new WatchUtil();
|
||||
TreeMap<WeatherAdvisoryWatch, WatchWork> map = new TreeMap<WeatherAdvisoryWatch, TemplateRunner.WatchWork>();
|
||||
GeospatialData[] geoData = null;
|
||||
|
||||
AreaSourceConfiguration asc = null;
|
||||
try {
|
||||
GeospatialDataAccessor gda = warngenLayer.getGeospatialDataAcessor();
|
||||
geoData = gda.getFeatures();
|
||||
asc = gda.getAreaConfig();
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),e);
|
||||
for (AreaSourceConfiguration a : warngenLayer.getConfiguration()
|
||||
.getAreaSources()) {
|
||||
if (a.getType() == AreaType.HATCHING) {
|
||||
asc = a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (asc == null) {
|
||||
statusHandler
|
||||
|
@ -1170,6 +1168,8 @@ public class TemplateRunner {
|
|||
"Cannot process watches: missing HATCHING area source configuration");
|
||||
return rval;
|
||||
}
|
||||
GeospatialData[] geoData = warngenLayer.getGeodataFeatures(
|
||||
asc.getAreaSource(), warngenLayer.getLocalizedSite());
|
||||
if ((geoData == null) || (geoData.length == 0)) {
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Cannot process watches: cannot get geospatial data");
|
||||
|
@ -1232,7 +1232,7 @@ public class TemplateRunner {
|
|||
rval.addWaw(work.waw);
|
||||
}
|
||||
} else {
|
||||
if (determineAffectedMarinePortions(work.ugcZone, geoData, work.waw)) {
|
||||
if (determineAffectedMarinePortions(work.ugcZone, asc, geoData, work.waw)) {
|
||||
rval.addWaw(work.waw);
|
||||
}
|
||||
}
|
||||
|
@ -1297,7 +1297,7 @@ public class TemplateRunner {
|
|||
for (Entry<String, Set<String>> e : map.entrySet()) {
|
||||
Portion portion = new Portion();
|
||||
try {
|
||||
portion.parentRegion = getStateName(e.getKey(), geoData)
|
||||
portion.parentRegion = getStateName(e.getKey(), asc, geoData)
|
||||
.toUpperCase();
|
||||
} catch (RuntimeException exc) {
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
|
@ -1330,7 +1330,8 @@ public class TemplateRunner {
|
|||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
private static boolean determineAffectedMarinePortions(List<String> ugcs,
|
||||
GeospatialData[] geoData, WeatherAdvisoryWatch waw) {
|
||||
AreaSourceConfiguration asc, GeospatialData[] geoData,
|
||||
WeatherAdvisoryWatch waw) {
|
||||
|
||||
// Maps state abbreviation to unique fe_area values
|
||||
HashMap<String, Set<String>> map = new HashMap<String, Set<String>>();
|
||||
|
@ -1509,7 +1510,7 @@ public class TemplateRunner {
|
|||
return abrev;
|
||||
}
|
||||
|
||||
private static String getStateName(String key,
|
||||
private static String getStateName(String key, AreaSourceConfiguration asc,
|
||||
GeospatialData[] geoData) {
|
||||
for (GeospatialData g : geoData) {
|
||||
if (key.equals(g.attributes.get("STATE"))) {
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
<!-- 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