Issue #1091 Fixed combination file generation.

Change-Id: I734709bfbda00a0914a9edcafd5611d08cea2cb2

Former-commit-id: 510cabe655 [formerly 4ca413a222 [formerly 0c4bf9ce1271334d2a07205a42efc60cf7c397f0]]
Former-commit-id: 4ca413a222
Former-commit-id: c264f72a53
This commit is contained in:
Ron Anderson 2012-10-12 09:14:27 -05:00
parent 45190d6fa0
commit e3d598d337
12 changed files with 62 additions and 52 deletions

View file

@ -1,33 +0,0 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
# Example localMapFiles.py configuration file
# Example of adding a new shapefile. The variable name must match
# the variable names you use in the localMaps.py filename definitions.
TimeZoneMapName = "tz_13sep02"
# Example of overriding the definition in MapFiles.py. In this example,
# the zone shapefile has been updated to the September 13, 2002 version:
ZoneMapName = 'z_13se02'

View file

@ -28,6 +28,7 @@ from Maps import *
# and named WY_countyName. # and named WY_countyName.
WYcounties = ShapeTable('County') WYcounties = ShapeTable('County')
WYcounties.filter(lambda x : x['state'] == "WY") WYcounties.filter(lambda x : x['state'] == "WY")
WYcounties.name = 'WYCounties'
WYcounties.editAreaName = ['state','countyname'] WYcounties.editAreaName = ['state','countyname']
WYcounties.groupName = 'WYCounties' WYcounties.groupName = 'WYCounties'
maps.append(WYcounties) maps.append(WYcounties)

View file

@ -28,6 +28,7 @@ from Maps import *
# and named WY_countyName. # and named WY_countyName.
WYcounties = ShapeTable('County') WYcounties = ShapeTable('County')
WYcounties.filter(lambda x : x['state'] == "WY") WYcounties.filter(lambda x : x['state'] == "WY")
WYcounties.name = 'WYCounties'
WYcounties.editAreaName = ['state','countyname'] WYcounties.editAreaName = ['state','countyname']
WYcounties.groupName = 'WYCounties' WYcounties.groupName = 'WYCounties'
maps.append(WYcounties) maps.append(WYcounties)

View file

@ -25,6 +25,9 @@ from Maps import *
# The following changes the configuration of the CWAzones maps. It overrides # The following changes the configuration of the CWAzones maps. It overrides
# every possible item that can be overridden. # every possible item that can be overridden.
# Rename by name of the CWAzones map
CWAzones.name = "MyCWAZones"
# Change the filter to only include "OH" (Ohio) zones # Change the filter to only include "OH" (Ohio) zones
CWAzones.filter(lambda x : x['state'] == "OH") CWAzones.filter(lambda x : x['state'] == "OH")

View file

@ -62,12 +62,6 @@ for MapFiles.py</a></td>
shapefile name configuration file.<br> shapefile name configuration file.<br>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: top;"><a href="localMapFiles.html">Syntax
for localMapFiles.py</a></td>
<td style="vertical-align: top;">Override file for using
different (e.g., updated) shapefiles for map backgrounds.</td>
</tr>
<tr> <tr>
<td style="vertical-align: top;"><a href="localMapsConfig.html">Syntax <td style="vertical-align: top;"><a href="localMapsConfig.html">Syntax
for localMaps.py</a></td> for localMaps.py</a></td>

View file

@ -88,8 +88,7 @@ will then stop. No network connections are brought up. </td>
<td style="vertical-align: top;">YES<br> <td style="vertical-align: top;">YES<br>
</td> </td>
<td style="vertical-align: top;">Runs the ifpServer in a BASELINE <td style="vertical-align: top;">Runs the ifpServer in a BASELINE
mode only.&nbsp; The localConfig, localMaps, localWxConfig, mode only.&nbsp; The localConfig, localMaps, localWxConfig are ignored.<br>
localMapFiles are ignored.<br>
</td> </td>
</tr> </tr>
<tr> <tr>

View file

@ -83,6 +83,7 @@ WYCounties):
</p> </p>
<PRE> <PRE>
WYcounties = ShapeTable('County') WYcounties = ShapeTable('County')
WYcounties.name = 'WYCounties'
WYcounties.filter(lambda x : x['state'] == "WY") WYcounties.filter(lambda x : x['state'] == "WY")
WYcounties.editAreaName = ['state','countyname'] WYcounties.editAreaName = ['state','countyname']
WYcounties.groupName = 'WYCounties' WYcounties.groupName = 'WYCounties'
@ -128,6 +129,7 @@ existing edit areas</h3>
You can modify the following characteristics of the map definition: You can modify the following characteristics of the map definition:
<ul> <ul>
<li>name of the database table (ShapeTable parameter)</li> <li>name of the database table (ShapeTable parameter)</li>
<li>name of the map background (.name line)</li>
<li>filtering (.filter line)</li> <li>filtering (.filter line)</li>
<li>generation of edit areas (.editAreaName line)</li> <li>generation of edit areas (.editAreaName line)</li>
<li>group name of generated edit areas (.groupName)</li> <li>group name of generated edit areas (.groupName)</li>
@ -137,6 +139,15 @@ Database Table Name</h4>
<p>If you want to change the name of the database table used for edit area generation, you will <p>If you want to change the name of the database table used for edit area generation, you will
need to remove the existing definition and <a href="#Adding">create a completely new map definition</a>.<br> need to remove the existing definition and <a href="#Adding">create a completely new map definition</a>.<br>
</p> </p>
<h4>Name of the Map Background</h4>
The format of the line is identical to that found in Maps.py.&nbsp;
Simply repeat the line you want to change and then put the new map name.
For example, if you want to change the CWAzones map name to MyCWAZones,
you would add the following line to localMaps.py:
<pre>
CWAzones.name = "MyCWAZones"
</pre>
Note: this name is only used in text formatter definitions in the mapNameForCombinations setting.
<h4>Filter Changes</h4> <h4>Filter Changes</h4>
The format of the line is identical to that found in Maps.py.&nbsp; The format of the line is identical to that found in Maps.py.&nbsp;
Simply repeat the line you want to change and then put in the new filter string.&nbsp; Simply repeat the line you want to change and then put in the new filter string.&nbsp;

View file

@ -17,16 +17,9 @@ Configuration</h1>
<h2><a name="Organization"></a><b>Organization</b></h2> <h2><a name="Organization"></a><b>Organization</b></h2>
<a href="#Maps.pyFormat">Maps.py Format</a> <br> <a href="#Maps.pyFormat">Maps.py Format</a> <br>
&nbsp;&nbsp;&nbsp;<a href="#SiteInformation">Site Information</a> <br> &nbsp;&nbsp;&nbsp;<a href="#SiteInformation">Site Information</a> <br>
&nbsp;&nbsp;&nbsp;<a href="#ShapefileNames">Shapefile Names</a> <br>
&nbsp;&nbsp;&nbsp;<a href="#MapDefinitions">Map Definitions</a> <br> &nbsp;&nbsp;&nbsp;<a href="#MapDefinitions">Map Definitions</a> <br>
&nbsp;&nbsp;&nbsp;<a href="#PuttingitallTogetherwiththemaplist">Putting it all togetherwith the maps list</a> <br> &nbsp;&nbsp;&nbsp;<a href="#PuttingitallTogetherwiththemaplist">Putting it all togetherwith the maps list</a> <br>
&nbsp;&nbsp;&nbsp;<a href="#ImportinglocalMaps">Importing localMaps</a><br> &nbsp;&nbsp;&nbsp;<a href="#ImportinglocalMaps">Importing localMaps</a><br>
<br>
<a href="#AWIPSstandardnames">AWIPS standard names</a> <br>
<a href="#ShapefileDescription">Shapefile Description</a><br>
&nbsp;&nbsp;&nbsp;<a href="#Filenames">Filenames</a> <br>
&nbsp;&nbsp;&nbsp;<a href="#CatalogEntryDescription">Catalog Entry Description</a> <br>
&nbsp;&nbsp;&nbsp;<a href="#Attributes">Attributes</a> <br>
<hr width="100%"> <hr width="100%">
<h2><a name="Overview"></a>Overview</h2> <h2><a name="Overview"></a>Overview</h2>
The Maps.py file defines how edit areas are generated for each map. The Maps.py file defines how edit areas are generated for each map.
@ -101,6 +94,7 @@ is passed as a parameter to the ShapeTable constructor.
<pre> <pre>
CWAzones = ShapeTable('zone') CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = ['state','zone'] CWAzones.editAreaName = ['state','zone']
</pre> </pre>
The ifpServer can automatically generate edit areas based on the The ifpServer can automatically generate edit areas based on the
@ -144,6 +138,7 @@ and creates an edit area with that name. The example below uses the simple
format for the editAreaName, in which only one attribute is specified. format for the editAreaName, in which only one attribute is specified.
<pre> <pre>
CWAzones = ShapeTable('zone') CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = 'zone' CWAzones.editAreaName = 'zone'
</pre> </pre>
<p>Examples of the names of the edit areas generated from the above <p>Examples of the names of the edit areas generated from the above
@ -197,6 +192,7 @@ form for the editAreaName, in which two attributes are specified.
</p> </p>
<pre> <pre>
CWAzones = ShapeTable('zone') CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = ['state','zone'] CWAzones.editAreaName = ['state','zone']
</pre> </pre>
<p>Examples of the names of the edit areas generated from the above <p>Examples of the names of the edit areas generated from the above
@ -332,6 +328,7 @@ def cwaEAN(atts):
return s #return the complete edit area name return s #return the complete edit area name
CWAcounties = ShapeTable('county') CWAcounties = ShapeTable('county')
CWAcounties.name = CWA + '_counties'
CWAcounties.editAreaName = cwaEAN CWAcounties.editAreaName = cwaEAN
</pre> </pre>
The "atts" dictionary looks simlilar to the following: The "atts" dictionary looks simlilar to the following:
@ -357,6 +354,7 @@ the generated edit areas will be placed in the edit area group called
'Zones'. 'Zones'.
<pre> <pre>
CWAzones = ShapeTable('zone') CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = 'zone' CWAzones.editAreaName = 'zone'
CWAzones.groupName = 'Zones' CWAzones.groupName = 'Zones'
</pre> </pre>
@ -377,6 +375,7 @@ Map Background Database</a>.
</p> </p>
<pre> <pre>
CWAzones = ShapeTable('Zone') CWAzones = ShapeTable('Zone')
CWAzones.name = CWA + '_zones'
CWAzones.filter(lambda x : x['cwa'] == CWA) CWAzones.filter(lambda x : x['cwa'] == CWA)
CWAzones.editAreaName = cwazones CWAzones.editAreaName = cwazones
</pre> </pre>
@ -388,6 +387,7 @@ def cwaZoneFilt(x):
return x['cwa'] == CWA return x['cwa'] == CWA
CWAzones = ShapeTable('zone') CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.filter(cwaZoneFilt) CWAzones.filter(cwaZoneFilt)
CWAzones.editAreaName = cwazones CWAzones.editAreaName = cwazones
</pre> </pre>
@ -403,6 +403,7 @@ def exampleFilt(x):
return x['countyname'] in myCounties and x['st'] == "OH" and x['cwa'] = 'CLE' return x['countyname'] in myCounties and x['st'] == "OH" and x['cwa'] = 'CLE'
OHcounties = ShapeTable('county') OHcounties = ShapeTable('county')
OHcounties.name = 'ExampleOHCounties'
OHcounties.filter(exampleFilt) OHcounties.filter(exampleFilt)
OHcounties.editAreaName = 'countyname' OHcounties.editAreaName = 'countyname'
</pre> </pre>
@ -413,6 +414,7 @@ Areas case except that the user has specified a group name. All
of the generated edit areas will be placed in the edit area group called 'Zones'. of the generated edit areas will be placed in the edit area group called 'Zones'.
<pre> <pre>
CWAzones = ShapeTable('zone') CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.filter(lambda x : x['cwa'] == CWA) CWAzones.filter(lambda x : x['cwa'] == CWA)
CWAzones.editAreaName = ['state','zone'] CWAzones.editAreaName = ['state','zone']
CWAzones.groupName = 'Zones' CWAzones.groupName = 'Zones'

View file

@ -44,6 +44,7 @@ CWA = siteConfig.GFESUITE_SITEID
# #
#MapNameVariable = ShapeTable('the name of the map table') #MapNameVariable = ShapeTable('the name of the map table')
#MapNameVariable.filter( -- - - - - filter string - - - - - - ) #MapNameVariable.filter( -- - - - - filter string - - - - - - )
#MapNameVariable.name = 'the display name of the map'
#MapNameVariable.editAreaName = 'attribute in ShapeTable to be used to name #MapNameVariable.editAreaName = 'attribute in ShapeTable to be used to name
# 'editArea' # 'editArea'
#MapNameVariable.groupName = 'name of the edit area group' #MapNameVariable.groupName = 'name of the edit area group'
@ -202,86 +203,102 @@ def offshoreZoneFilter(atts):
# CWA Counties # CWA Counties
CWAcounties = ShapeTable('county') CWAcounties = ShapeTable('county')
CWAcounties.filter(lambda x : x['cwa'][0:3] == CWA or x['cwa'][3:6] == CWA) CWAcounties.filter(lambda x : x['cwa'][0:3] == CWA or x['cwa'][3:6] == CWA)
CWAcounties.name = 'Counties_' + CWA
CWAcounties.editAreaName = ['state','countyname'] CWAcounties.editAreaName = ['state','countyname']
CWAcounties.groupName = 'Counties' CWAcounties.groupName = 'Counties'
# FIPS for my counties - only include first WFO indicated in CWA field # FIPS for my counties - only include first WFO indicated in CWA field
FIPS = ShapeTable('county') FIPS = ShapeTable('county')
FIPS.name = 'FIPS_' + CWA
FIPS.filter(lambda x : x['cwa'][0:3] == CWA) FIPS.filter(lambda x : x['cwa'][0:3] == CWA)
FIPS.editAreaName = fips FIPS.editAreaName = fips
FIPS.groupName = 'FIPS_' + CWA FIPS.groupName = 'FIPS_' + CWA
# Unfiltered Counties # Unfiltered Counties
Counties = ShapeTable('county') Counties = ShapeTable('county')
Counties.name = 'Counties'
Counties.editAreaName = fips Counties.editAreaName = fips
Counties.groupName = 'FIPS' Counties.groupName = 'FIPS'
# CWA Zones # CWA Zones
CWAzones = ShapeTable('zone') CWAzones = ShapeTable('zone')
CWAzones.filter(publicZoneFilter) CWAzones.filter(publicZoneFilter)
CWAzones.name = 'Zones_' + CWA
CWAzones.editAreaName = cwazones CWAzones.editAreaName = cwazones
CWAzones.groupName = 'Zones_' + CWA CWAzones.groupName = 'Zones_' + CWA
# Unfiltered Zones # Unfiltered Zones
Zones = ShapeTable('zone') Zones = ShapeTable('zone')
Zones.name = 'Zones'
Zones.editAreaName = cwazones Zones.editAreaName = cwazones
Zones.groupName = 'Zones' Zones.groupName = 'Zones'
# Fire Wx Zones # Fire Wx Zones
FWCWAzones = ShapeTable('firewxzones') FWCWAzones = ShapeTable('firewxzones')
FWCWAzones.filter(firewxZoneFilter) FWCWAzones.filter(firewxZoneFilter)
FWCWAzones.name = 'FireWxZones_' + CWA
FWCWAzones.editAreaName = fwxzones FWCWAzones.editAreaName = fwxzones
FWCWAzones.groupName = 'FireWxZones_' + CWA FWCWAzones.groupName = 'FireWxZones_' + CWA
# Unfiltered Fire Wx Zones # Unfiltered Fire Wx Zones
FWZones = ShapeTable('firewxzones') FWZones = ShapeTable('firewxzones')
FWZones.name = 'FireWxZones'
FWZones.editAreaName = fwxzones FWZones.editAreaName = fwxzones
FWZones.groupName = 'FireWxZones' FWZones.groupName = 'FireWxZones'
# CWAs for all # CWAs for all
cwas = ShapeTable('cwa') cwas = ShapeTable('cwa')
cwas.name = 'CWA_all'
cwas.editAreaName = 'wfo' cwas.editAreaName = 'wfo'
cwas.groupName = 'WFOs' cwas.groupName = 'WFOs'
# ISC areas for all # ISC areas for all
isc = ShapeTable('isc') isc = ShapeTable('isc')
isc.name = 'ISC_all'
isc.editAreaName = ['ISC','wfo'] isc.editAreaName = ['ISC','wfo']
isc.groupName = 'ISC' isc.groupName = 'ISC'
# Fire Wx AOR for all # Fire Wx AOR for all
fwaor = ShapeTable('firewxaor') fwaor = ShapeTable('firewxaor')
fwaor.name = 'FireWxAOR'
fwaor.editAreaName = ['FireWxAOR', 'cwa'] fwaor.editAreaName = ['FireWxAOR', 'cwa']
fwaor.groupName = 'FireWxAOR' fwaor.groupName = 'FireWxAOR'
# Marine Zones for CWA # Marine Zones for CWA
CWAmzones = ShapeTable('marinezones') CWAmzones = ShapeTable('marinezones')
CWAmzones.filter(marineZoneFilter) CWAmzones.filter(marineZoneFilter)
CWAmzones.name = 'Marine_Zones_' + CWA
CWAmzones.editAreaName = marineZ CWAmzones.editAreaName = marineZ
CWAmzones.groupName = 'MZones_' + CWA CWAmzones.groupName = 'MZones_' + CWA
# Marine Zones (unfiltered) # Marine Zones (unfiltered)
Mzones = ShapeTable('marinezones') Mzones = ShapeTable('marinezones')
Mzones.name = "Marine_Zones"
Mzones.editAreaName = marineZ Mzones.editAreaName = marineZ
Mzones.groupName = 'MZones' Mzones.groupName = 'MZones'
# States (unfiltered) # States (unfiltered)
States = ShapeTable('states') States = ShapeTable('states')
States.name = "States"
States.editAreaName = 'name' States.editAreaName = 'name'
States.groupName = 'States' States.groupName = 'States'
# RFC maps # RFC maps
rfc = ShapeTable('rfc') rfc = ShapeTable('rfc')
rfc.name = "RFC"
rfc.editAreaName = ['ISC','site_id'] rfc.editAreaName = ['ISC','site_id']
rfc.groupName = 'ISC' rfc.groupName = 'ISC'
# Offshore Marine Zones - unfiltered # Offshore Marine Zones - unfiltered
offshore = ShapeTable('offshore') offshore = ShapeTable('offshore')
offshore.name = "Offshore_Marine_Zones"
offshore.editAreaName = offshoreZ offshore.editAreaName = offshoreZ
offshore.groupName = 'OffShoreMZones' offshore.groupName = 'OffShoreMZones'
# Offshore Marine Zones - filtered by CWA # Offshore Marine Zones - filtered by CWA
offshoreCWA = ShapeTable('offshore') offshoreCWA = ShapeTable('offshore')
offshoreCWA.filter(offshoreZoneFilter) offshoreCWA.filter(offshoreZoneFilter)
offshoreCWA.name = "Offshore_Marine_Zones_" + CWA
offshoreCWA.editAreaName = offshoreZ offshoreCWA.editAreaName = offshoreZ
offshoreCWA.groupName = 'OffShoreMZones_' + CWA offshoreCWA.groupName = 'OffShoreMZones_' + CWA

View file

@ -93,6 +93,8 @@ public class DbShapeSource {
private boolean filtered = false; private boolean filtered = false;
private String displayName;
private boolean hasEditAreaName = false; private boolean hasEditAreaName = false;
private String groupName; private String groupName;
@ -357,6 +359,14 @@ public class DbShapeSource {
return this.featureCollection.size(); return this.featureCollection.size();
} }
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String name) {
this.displayName = name;
}
public String getGroupName() { public String getGroupName() {
return groupName; return groupName;
} }

View file

@ -392,7 +392,10 @@ public class MapManager {
String error = "********* EDIT AREA GENERATION ERROR - MakeReferenceData *********\n" String error = "********* EDIT AREA GENERATION ERROR - MakeReferenceData *********\n"
+ "Error in generating edit areas, map #" + "Error in generating edit areas, map #"
+ i + i
+ " Basename: " + m.getTableName(); + " Name: "
+ m.getDisplayName()
+ " Basename: "
+ m.getTableName();
statusHandler.error(error, e); statusHandler.error(error, e);
_mapErrors.add(error); _mapErrors.add(error);
} finally { } finally {
@ -484,7 +487,7 @@ public class MapManager {
return; return;
} }
statusHandler.debug("creating: " + mapDef.getTableName()); statusHandler.debug("creating: " + mapDef.getDisplayName());
List<ReferenceData> data = createReferenceData(mapDef); List<ReferenceData> data = createReferenceData(mapDef);
if (data.size() == 0) { if (data.size() == 0) {
return; return;
@ -896,13 +899,13 @@ public class MapManager {
} catch (Exception e) { } catch (Exception e) {
String error = "********* EDIT AREA GENERATION ERROR - Create Reference Data *********\n" String error = "********* EDIT AREA GENERATION ERROR - Create Reference Data *********\n"
+ "Error in generating edit areas from maps for map " + "Error in generating edit areas from maps for map "
+ mapDef.getTableName(); + mapDef.getDisplayName();
statusHandler.error(error, e); statusHandler.error(error, e);
_mapErrors.add(error); _mapErrors.add(error);
} }
statusHandler.debug("EAs: " + created); statusHandler.debug("EAs: " + created);
editAreaMap.put(mapDef.getTableName(), created); editAreaMap.put(mapDef.getDisplayName(), created);
return data; return data;
} }

View file

@ -38,6 +38,7 @@ from com.raytheon.edex.plugin.gfe.reference import DbShapeSource
class ShapeTable(JUtil.JavaWrapperClass): class ShapeTable(JUtil.JavaWrapperClass):
def __init__(self, identifier): def __init__(self, identifier):
self.identifier = identifier self.identifier = identifier
self.name = None
self.editAreaName = None self.editAreaName = None
self.groupName = None self.groupName = None
self.javaObj = DbShapeSource(identifier) self.javaObj = DbShapeSource(identifier)
@ -63,6 +64,7 @@ class ShapeTable(JUtil.JavaWrapperClass):
return "" return ""
def toJavaObj(self): def toJavaObj(self):
self.javaObj.setDisplayName(self.name)
self.javaObj.setGroupName(self.groupName) self.javaObj.setGroupName(self.groupName)
if self.editAreaName is not None: if self.editAreaName is not None:
self.javaObj.setHasEditAreaName(True); self.javaObj.setHasEditAreaName(True);