Issue #1625 Updated addOrRemoveCounty method.

Former-commit-id: cd6dd3c178 [formerly 18760c0895c1776dd0448b0bb699ab5506c45511]
Former-commit-id: 8c2c7c97f7
This commit is contained in:
Jonathan Sanchez 2013-02-25 17:15:09 -06:00
parent 1255b87e2e
commit d4f4832d1a

View file

@ -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));