Merge branch 'master_13.5.2' (13.5.2-5) into omaha_13.5.2
Former-commit-id:ae10695a27
[formerly4bd09261ee
] [formerlyae10695a27
[formerly4bd09261ee
] [formerly3aa91aa5c7
[formerly 7da2eecc2d0143bb46b91ef3f9c38070044db99b]]] Former-commit-id:3aa91aa5c7
Former-commit-id:a33e660c6b
[formerly017b5388d0
] Former-commit-id:c25e81351d
This commit is contained in:
commit
0b00f06e20
5 changed files with 73 additions and 20 deletions
|
@ -34,6 +34,8 @@ import java.util.List;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 24, 2013 2189 mschenke Initial creation
|
||||
* Sep 13, 2013 16581 kshrestha Variables scaleFont and smoothing
|
||||
* initialized to true.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,9 +47,9 @@ public abstract class AbstractAWTFont implements IFont {
|
|||
|
||||
protected Font font;
|
||||
|
||||
protected boolean scaleFont;
|
||||
protected boolean scaleFont = true;
|
||||
|
||||
protected boolean smoothing;
|
||||
protected boolean smoothing = true;
|
||||
|
||||
protected AbstractAWTFont(String fontName, float fontSize, Style[] styles) {
|
||||
this(new Font(fontName, toAwtStyle(styles), (int) fontSize));
|
||||
|
|
|
@ -68,6 +68,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Aug 27, 2013 #2287 randerso Replaced hard coded constant with densityFactor
|
||||
* parameter to allow application specific density
|
||||
* scaling to better match A1 displays
|
||||
* Sep 10, 2013 DR 16257 MPorricelli Fix so that wind for global grids displays on
|
||||
* mercator maps.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -215,14 +217,31 @@ public abstract class AbstractGriddedDisplay<T> implements IRenderable {
|
|||
// space
|
||||
// Linear distance(between (0,0) and (0,1) makes more sense but
|
||||
// looks to sparse.
|
||||
DirectPosition2D p1 = new DirectPosition2D(0, 0);
|
||||
DirectPosition2D p2 = new DirectPosition2D(1, 1);
|
||||
try {
|
||||
grid2grid.transform(p1, p1);
|
||||
grid2grid.transform(p2, p2);
|
||||
} catch (TransformException e) {
|
||||
throw new VizException(e);
|
||||
}
|
||||
DirectPosition2D p1 = new DirectPosition2D();
|
||||
DirectPosition2D p2 = new DirectPosition2D();
|
||||
|
||||
boolean doneTryingCoords = false;
|
||||
int i = -1;
|
||||
// starting with coords (0,0), (1,1), try until tranform succeeds,
|
||||
// or until have gone through a set of diagonal coords
|
||||
do {
|
||||
try {
|
||||
i++;
|
||||
if (i + 1 < gridDims[0] && i + 1 < gridDims[1]) {
|
||||
p1.x = p1.y = i;
|
||||
p2.x = p2.y = i + 1;
|
||||
grid2grid.transform(p1, p1);
|
||||
grid2grid.transform(p2, p2);
|
||||
doneTryingCoords = true;
|
||||
}
|
||||
} catch (TransformException e) {
|
||||
if (i + 1 >= gridDims[0] || i + 1 >= gridDims[1]) {
|
||||
doneTryingCoords = true;
|
||||
throw new VizException(e);
|
||||
}
|
||||
}
|
||||
} while (!doneTryingCoords);
|
||||
|
||||
pixelSize = p1.distance(p2);
|
||||
|
||||
IExtent viewPixelExtent = paintProps.getView().getExtent();
|
||||
|
|
|
@ -61,6 +61,10 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* adjustment of density.
|
||||
* Added gridRelative flag to indicate whether direction
|
||||
* data is relative to grid or true north
|
||||
* Sep 9, 2013 DR16257 MPorricelli When setDestinationGeographicPoint fails (which can
|
||||
* happen for global lat/lon grid winds displayed on
|
||||
* Equidistant Cylindrical map) try again with different
|
||||
* pixel location.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -157,7 +161,7 @@ public class GriddedVectorDisplay extends AbstractGriddedDisplay<Coordinate> {
|
|||
if (Float.isNaN(spd) || Float.isNaN(dir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int tryDiffPixLoc = 0;
|
||||
try {
|
||||
ReferencedCoordinate rCoord = new ReferencedCoordinate(
|
||||
gridGeometryOfGrid, ijcoord);
|
||||
|
@ -169,12 +173,24 @@ public class GriddedVectorDisplay extends AbstractGriddedDisplay<Coordinate> {
|
|||
|
||||
if (stationPixelLocation != null) {
|
||||
stationPixelLocation[1]--;
|
||||
double[] newWorldLocation = this.descriptor
|
||||
.pixelToWorld(stationPixelLocation);
|
||||
this.gc.setStartingGeographicPoint(stationLocation[0],
|
||||
stationLocation[1]);
|
||||
this.gc.setDestinationGeographicPoint(newWorldLocation[0],
|
||||
newWorldLocation[1]);
|
||||
do {
|
||||
try {
|
||||
double[] newWorldLocation = this.descriptor
|
||||
.pixelToWorld(stationPixelLocation);
|
||||
this.gc.setStartingGeographicPoint(stationLocation[0],
|
||||
stationLocation[1]);
|
||||
this.gc.setDestinationGeographicPoint(
|
||||
newWorldLocation[0], newWorldLocation[1]);
|
||||
tryDiffPixLoc = 2; // setting of pts succeeded; do not need to try again
|
||||
|
||||
} catch (Exception e2) {
|
||||
if (tryDiffPixLoc == 0) { // setting of points failed first time through
|
||||
stationPixelLocation[1] += 2; // try pixel location in opposite dir of 1st try
|
||||
tryDiffPixLoc++;
|
||||
} else
|
||||
throw new VizException(e2); // failed on second try; give up
|
||||
}
|
||||
} while (tryDiffPixLoc < 2);
|
||||
}
|
||||
|
||||
if (gridRelative) {
|
||||
|
@ -185,6 +201,7 @@ public class GriddedVectorDisplay extends AbstractGriddedDisplay<Coordinate> {
|
|||
|
||||
// rotate dir from true north to display up
|
||||
dir -= this.gc.getAzimuth();
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new VizException(e);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,10 @@ import org.opengis.referencing.operation.TransformException;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 13, 2011 bsteffen Initial creation
|
||||
* Sep 10, 2013 DR 16257 MPorricelli Eliminate values that
|
||||
* fail to be tranformed,e.g.
|
||||
* when too close to pole for
|
||||
* mercator projections
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -146,7 +150,19 @@ public class PlotLocationCache {
|
|||
ConcatenatedTransform.create(grid2crs, crs2crs),
|
||||
crs2grid);
|
||||
|
||||
grid2grid.transform(result, 0, result, 0, xDim * yDim);
|
||||
try {
|
||||
grid2grid.transform(result, 0, result, 0, xDim * yDim);
|
||||
} catch (TransformException e1) {
|
||||
// Set values to NaN when fail transform
|
||||
for (int i = 0; i < result.length; i += 2) {
|
||||
try {
|
||||
grid2grid.transform(result, i, result, i, 1);
|
||||
} catch (TransformException e2) {
|
||||
result[i] = Float.NaN;
|
||||
result[i + 1] = Float.NaN;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (FactoryException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InvalidGridGeometryException e) {
|
||||
|
|
|
@ -40,6 +40,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
|
|||
* Mar 25, 2013 1605 jsanchez Set ClosestPoint's prepGeom.
|
||||
* Apr 24, 2013 1944 jsanchez Updated calculateLocationPortion visibility to public.
|
||||
* May 2, 2013 1963 jsanchez Referenced calculatePortion from GisUtil if intersection less than DEFAULT_PORTION_TOLERANCE.
|
||||
* Sep 13, 2013 DR 16601 D. Friedman Fix from jsanchez: Allow cities outside the CWA.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -156,8 +157,6 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
|
|||
filter = new HashMap<String, RequestConstraint>();
|
||||
}
|
||||
|
||||
filter.put(cwaField, new RequestConstraint(localizedSite));
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue