Issue #1006 fix supdirs
Former-commit-id:09bdc765e5
[formerly 09109d26f68e527f843013883dc7f3082f01dd7a] Former-commit-id:44d21bfe36
This commit is contained in:
parent
f1a836d0bb
commit
b048808367
1 changed files with 28 additions and 3 deletions
|
@ -15,6 +15,7 @@ import com.raytheon.uf.common.geospatial.SpatialQueryResult;
|
|||
import com.raytheon.viz.warngen.PreferenceUtil;
|
||||
import com.raytheon.viz.warngen.gis.ClosestPoint;
|
||||
import com.raytheon.viz.warngen.gis.GisUtil;
|
||||
import com.raytheon.viz.warngen.gis.GisUtil.Direction;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
|
@ -94,9 +95,33 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
|
|||
partOfArea = GisUtil.asStringList(GisUtil.calculatePortion(geom,
|
||||
intersection, gc, ""));
|
||||
|
||||
String suppressedDirections = String.valueOf(attributes
|
||||
.get(suppressedDirectionsField));
|
||||
partOfArea.remove(suppressedDirections);
|
||||
if (attributes.get(suppressedDirectionsField) != null) {
|
||||
String suppressedDirections = String.valueOf(
|
||||
attributes.get(suppressedDirectionsField))
|
||||
.toLowerCase();
|
||||
// supdirs can be 'nse', for example
|
||||
// TODO create an enum constructor for Directions
|
||||
for (int i = 0; i < suppressedDirections.length(); i++) {
|
||||
switch (suppressedDirections.charAt(i)) {
|
||||
case 'n':
|
||||
partOfArea.remove(Direction.NORTH.toString());
|
||||
break;
|
||||
case 's':
|
||||
partOfArea.remove(Direction.SOUTH.toString());
|
||||
break;
|
||||
case 'e':
|
||||
partOfArea.remove(Direction.EAST.toString());
|
||||
break;
|
||||
case 'w':
|
||||
partOfArea.remove(Direction.WEST.toString());
|
||||
break;
|
||||
case 'c':
|
||||
partOfArea.remove(Direction.CENTRAL.toString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return partOfArea;
|
||||
|
|
Loading…
Add table
Reference in a new issue