Merge "Issue #1091 Fixed combination file generation." into development

Former-commit-id: 7640b281fa [formerly 5064bd8734] [formerly 7640b281fa [formerly 5064bd8734] [formerly 678110fd31 [formerly f9431f2bd771225cac164a0d7ecf04166844d213]]]
Former-commit-id: 678110fd31
Former-commit-id: c82da89068 [formerly 6ab5f4d00c]
Former-commit-id: 9b345dea77
This commit is contained in:
Ron Anderson 2012-10-12 11:44:28 -05:00 committed by Gerrit Code Review
commit 33051b9799
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.
WYcounties = ShapeTable('County')
WYcounties.filter(lambda x : x['state'] == "WY")
WYcounties.name = 'WYCounties'
WYcounties.editAreaName = ['state','countyname']
WYcounties.groupName = 'WYCounties'
maps.append(WYcounties)

View file

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

View file

@ -25,6 +25,9 @@ from Maps import *
# The following changes the configuration of the CWAzones maps. It overrides
# 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
CWAzones.filter(lambda x : x['state'] == "OH")

View file

@ -62,12 +62,6 @@ for MapFiles.py</a></td>
shapefile name configuration file.<br>
</td>
</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>
<td style="vertical-align: top;"><a href="localMapsConfig.html">Syntax
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>
<td style="vertical-align: top;">Runs the ifpServer in a BASELINE
mode only.&nbsp; The localConfig, localMaps, localWxConfig,
localMapFiles are ignored.<br>
mode only.&nbsp; The localConfig, localMaps, localWxConfig are ignored.<br>
</td>
</tr>
<tr>

View file

@ -83,6 +83,7 @@ WYCounties):
</p>
<PRE>
WYcounties = ShapeTable('County')
WYcounties.name = 'WYCounties'
WYcounties.filter(lambda x : x['state'] == "WY")
WYcounties.editAreaName = ['state','countyname']
WYcounties.groupName = 'WYCounties'
@ -128,6 +129,7 @@ existing edit areas</h3>
You can modify the following characteristics of the map definition:
<ul>
<li>name of the database table (ShapeTable parameter)</li>
<li>name of the map background (.name line)</li>
<li>filtering (.filter line)</li>
<li>generation of edit areas (.editAreaName line)</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
need to remove the existing definition and <a href="#Adding">create a completely new map definition</a>.<br>
</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>
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;

View file

@ -17,16 +17,9 @@ Configuration</h1>
<h2><a name="Organization"></a><b>Organization</b></h2>
<a href="#Maps.pyFormat">Maps.py Format</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="#PuttingitallTogetherwiththemaplist">Putting it all togetherwith the maps list</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%">
<h2><a name="Overview"></a>Overview</h2>
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>
CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = ['state','zone']
</pre>
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.
<pre>
CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = 'zone'
</pre>
<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>
<pre>
CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = ['state','zone']
</pre>
<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
CWAcounties = ShapeTable('county')
CWAcounties.name = CWA + '_counties'
CWAcounties.editAreaName = cwaEAN
</pre>
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'.
<pre>
CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.editAreaName = 'zone'
CWAzones.groupName = 'Zones'
</pre>
@ -377,6 +375,7 @@ Map Background Database</a>.
</p>
<pre>
CWAzones = ShapeTable('Zone')
CWAzones.name = CWA + '_zones'
CWAzones.filter(lambda x : x['cwa'] == CWA)
CWAzones.editAreaName = cwazones
</pre>
@ -388,6 +387,7 @@ def cwaZoneFilt(x):
return x['cwa'] == CWA
CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.filter(cwaZoneFilt)
CWAzones.editAreaName = cwazones
</pre>
@ -403,6 +403,7 @@ def exampleFilt(x):
return x['countyname'] in myCounties and x['st'] == "OH" and x['cwa'] = 'CLE'
OHcounties = ShapeTable('county')
OHcounties.name = 'ExampleOHCounties'
OHcounties.filter(exampleFilt)
OHcounties.editAreaName = 'countyname'
</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'.
<pre>
CWAzones = ShapeTable('zone')
CWAzones.name = CWA + '_zones'
CWAzones.filter(lambda x : x['cwa'] == CWA)
CWAzones.editAreaName = ['state','zone']
CWAzones.groupName = 'Zones'

View file

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

View file

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

View file

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

View file

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