CM-MERGE:OB13.5.5-7 into 14.1.2
Former-commit-id:509616ba6a
[formerlyf8ed9c7944
] [formerlye9bd17a21f
[formerly 3595e9c0962e9ef4ea987da3c52fdaf8b9b68114]] Former-commit-id:e9bd17a21f
Former-commit-id:409a48b907
This commit is contained in:
parent
fe9ee785b6
commit
e563eb3376
1 changed files with 16 additions and 0 deletions
|
@ -48,7 +48,9 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.viz.warngen.gui.WarngenLayer;
|
||||
import com.raytheon.viz.warngen.util.Abbreviation;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.PrecisionModel;
|
||||
import com.vividsolutions.jts.geom.prep.PreparedGeometry;
|
||||
import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer;
|
||||
|
||||
/**
|
||||
* Area
|
||||
|
@ -75,6 +77,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry;
|
|||
* May 2, 2013 1963 jsanchez Updated method to determine partOfArea.
|
||||
* Aug 19, 2013 2177 jsanchez Used portionsUtil to calculate area portion descriptions.
|
||||
* Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization.
|
||||
* May 16, 2014 DR 17365 D. Friedman Reduce warning area precision to avoid topology errors.
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -84,6 +87,8 @@ public class Area {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(Area.class);
|
||||
|
||||
private static final double REDUCED_PRECISION_SCALE = 1000000000.0;
|
||||
|
||||
/**
|
||||
* If an area greater than this percentage of the area is covered, no
|
||||
* direction is included
|
||||
|
@ -292,6 +297,17 @@ public class Area {
|
|||
WarngenLayer warngenLayer) throws VizException {
|
||||
Map<String, Object> areasMap = new HashMap<String, Object>();
|
||||
|
||||
Geometry simplifiedArea = null;
|
||||
try {
|
||||
simplifiedArea = (new SimpleGeometryPrecisionReducer(new PrecisionModel(
|
||||
REDUCED_PRECISION_SCALE))).reduce(warnArea);
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
if (simplifiedArea != null && simplifiedArea.isValid()) {
|
||||
warnArea = simplifiedArea;
|
||||
}
|
||||
|
||||
String hatchedAreaSource = config.getHatchedAreaSource()
|
||||
.getAreaSource();
|
||||
for (AreaSourceConfiguration asc : config.getAreaSources()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue