Merge branch 'asm_15.1.1' of ssh://10.201.30.8:29418/AWIPS2_baseline into int_15.1.1

Conflicts:
	cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gis/PolygonUtil.java

Former-commit-id: 53eed5ee0c73100c13f7fef013bff6061db4815b
This commit is contained in:
Fay.Liang 2015-05-13 15:08:02 -04:00
commit e568ee4b4c
6 changed files with 76 additions and 21 deletions

View file

@ -65,7 +65,8 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType;
* Feb 16, 2011 7878 rferrel Modifications to use ids.cfg file.
* Apr 08, 2011 8856 rferrel Can now make a new station's templates
* May 24, 2011 9060 rferrel Limit downloading of localization files.
* Aug 09, 2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR
* Aug 09, 2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR
* May 04, 2015 17417 yteng Get all sites from product
*
* </pre>
*
@ -299,13 +300,10 @@ public class TafSiteConfigIni implements ITafSiteConfig {
HierarchicalINIConfiguration config = getProductConfig(product);
if (config != null) {
config.setDelimiterParsingDisabled(true);
String sites = config.getString("sites.idents");
if (sites != null) {
String[] idents = config.getString("sites.idents").split(
"\\s*,\\s*", 0);
for (String id : idents) {
siteList.add(id);
String[] sites = config.getStringArray("sites.idents");
if (sites != null && sites.length > 0) {
for (String site : sites) {
siteList.add(site);
}
}
}

View file

@ -19,7 +19,10 @@
further_licensing_information.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="menuItem" menuText="Cloud Cover" key="CCP" indentText="false" />
<contribute xsi:type="menuItem" menuText="Cloud Cover Anl Uncertainty" key="CCPerranl" indentText="false" />
<contribute xsi:type="menuItem" menuText="Visibility" key="Vis" indentText="false" />
<contribute xsi:type="menuItem" menuText="Visibility Anl Uncertainty" key="Viserranl" indentText="false" />
<contribute xsi:type="menuItem" menuText="Turbulence" key="TURB" indentText="false" />
<contribute xsi:type="menuItem" menuText="Turbulence Index" key="TPFI" indentText="false" />
<contribute xsi:type="menuItem" menuText="Icing Probability" key="ICPRB" indentText="false" />

View file

@ -54,6 +54,7 @@ import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.geom.PrecisionModel;
import com.vividsolutions.jts.geom.TopologyException;
import com.vividsolutions.jts.geom.prep.PreparedGeometry;
import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer;
@ -89,6 +90,7 @@ import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer;
* 06/27/2014 DR 17443 D. Friedman Fix some odd cases in which parts of a polygon not covering a
* hatched area would be retained after redrawing.
* 07/22/2014 DR 17475 Qinglu Lin Updated createPolygonByPoints() and created second createPolygonByPoints().
* 04/29/2015 DR 17310 D. Friedman Use Geometry.buffer() to fix self-intersections. Fix bug in alterVertexes.
* 05/08/2015 DR 17310 D. Friedman Prevent reducePoints from generating invalid polygons.
* </pre>
*
@ -547,6 +549,19 @@ public class PolygonUtil {
Polygon rval = gf.createPolygon(gf.createLinearRing(points
.toArray(new Coordinate[points.size()])), null);
if (!rval.isValid()) {
System.out.format("Polygon %s is invalid. Attempting to fix...\n", rval);
try {
Polygon p2 = (Polygon) rval.buffer(0.0);
rval = gf.createPolygon((LinearRing) p2.getExteriorRing());
} catch (TopologyException e) {
System.out.format("...fix failed\n");
} catch (ClassCastException e) {
System.out.format("...resulted in something other than a polygon\n");
}
System.out.format("...fixed. Result: %s\n", rval);
}
if (rval.isValid() == false) {
System.out.println("Fixing intersected segments");
Coordinate[] coords = rval.getCoordinates();
@ -1713,8 +1728,8 @@ public class PolygonUtil {
if (intersectCoord != null) {
index1 = calcShortestDistance(intersectCoord, ls1);
index2 = calcShortestDistance(intersectCoord, ls2);
Coordinate c = new Coordinate(0.5*(coord[index1].x + coord[2+index2].x),
0.5*(coord[index1].y + coord[2+index2].y));
Coordinate c = new Coordinate(0.5*(coord[index[index1]].x + coord[index[2+index2]].x),
0.5*(coord[index[index1]].y + coord[index[2+index2]].y));
PolygonUtil.round(c, 2);
coord[index[index1]] = new Coordinate(c);
coord[index[2+index2]] = new Coordinate(c);

View file

@ -159,6 +159,10 @@ import com.vividsolutions.jts.geom.Polygon;
* Jul 01, 2014 DR 17450 D. Friedman Use list of templates from backup site.
* Jul 21, 2014 3419 jsanchez Created a hidden button to make recreating polygons easier.
* Feb 26, 2015 3353 rjpeter Fixed NPE on clear.
* Apr 27, 2015 DR 17359 Qinglu Lin Updated changeTemplate(). The approach for solving slowness issue while switching from
* one marine product to another is to skip computing hatching area. The hatching area might
* not be as expected if percentage/area is different between the two products. But the
* chance for that to occur is trivial.
* </pre>
*
* @author chammack
@ -1657,14 +1661,17 @@ public class WarngenDialog extends CaveSWTDialog implements
.equalsIgnoreCase(lastAreaSource);
boolean snapHatchedAreaToPolygon = isDifferentAreaSources;
boolean preservedSelection = !isDifferentAreaSources;
// If template has a different hatched area source from the previous
// template, then the warned area would be based on the polygon and not
// preserved.
try {
warngenLayer.updateWarnedAreas(snapHatchedAreaToPolygon,
preservedSelection);
} catch (VizException e1) {
statusHandler.handle(Priority.PROBLEM, "WarnGen Error", e1);
if (isDifferentAreaSources || !warngenLayer.getConfiguration()
.getHatchedAreaSource().getAreaSource().toLowerCase().equals("marinezones")) {
// If template has a different hatched area source from the previous
// template, then the warned area would be based on the polygon and not
// preserved.
try {
warngenLayer.updateWarnedAreas(snapHatchedAreaToPolygon,
preservedSelection);
} catch (VizException e1) {
statusHandler.handle(Priority.PROBLEM, "WarnGen Error", e1);
}
}
// Properly sets the "Create Text" button.
setInstructions();

View file

@ -68,6 +68,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Mar 04, 2014 2832 njensen Moved disposeInternal() to abstract class
* Apr 07, 2014 2959 njensen Correct handling of color change
* Apr 14, 2014 DR 17257 D. Friedman Redo time matching on per-minute refresh.
* Apr 28, 2015 ASM #15008 D. Friedman Create polygon for EXTs even if original product is not found.
*
* </pre>
*
@ -268,9 +269,11 @@ public class WarningsResource extends AbstractWWAResource {
}
}
}
// create the new polygon for the CON outside of the above
// for loop
if (createShape != null) {
/* Create a new polygon for the follow-up to the original
* product found in the above loop. Also create a polygon
* for EXT actions even if the original was not found.
*/
if (createShape != null || act == WarningAction.EXT) {
initShape(target, warnrec);
}
} else {

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<!--
Refer to edex/modes/README.txt for documentation
-->
<edexModes>
<mode name="ingestHydro">
<include>ndm-ingest.xml</include>
</mode>
</edexModes>