Issue #1625 Updated addOrRemoveCounty method.
Former-commit-id: 18760c0895c1776dd0448b0bb699ab5506c45511
This commit is contained in:
parent
eff20112d2
commit
8c2c7c97f7
1 changed files with 12 additions and 12 deletions
|
@ -2278,21 +2278,21 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
|||
if (fipsIds.contains(featureFips) == false) {
|
||||
break;
|
||||
} else if (oldWarningPolygon.contains(point) == true) {
|
||||
boolean first = true;
|
||||
// Get intersecting parts for each geom with
|
||||
// matching fips
|
||||
List<Geometry> fipsParts = new ArrayList<Geometry>(
|
||||
dataWithFips.size());
|
||||
for (GeospatialData g : dataWithFips) {
|
||||
if (first) {
|
||||
geom = GeometryUtil.intersection(
|
||||
g.geometry, oldWarningArea);
|
||||
first = false;
|
||||
} else {
|
||||
geom = GeometryUtil.intersection(
|
||||
g.geometry, geom);
|
||||
}
|
||||
fipsParts.add(GeometryUtil.intersection(
|
||||
oldWarningArea, g.geometry));
|
||||
}
|
||||
|
||||
// Create a collection of each part
|
||||
geom = GeometryUtil.union(fipsParts
|
||||
.toArray(new Geometry[0]));
|
||||
if (warningPolygon.contains(point)) {
|
||||
geom = GeometryUtil.intersection(geom,
|
||||
warningPolygon);
|
||||
// If inside warning polygon, intersect
|
||||
geom = GeometryUtil.intersection(
|
||||
warningPolygon, geom);
|
||||
}
|
||||
state.setWarningArea(GeometryUtil.union(
|
||||
state.getWarningArea(), geom));
|
||||
|
|
Loading…
Add table
Reference in a new issue