Issue #2132 - review comments

Change-Id: I65b880b5f96471b6f8e0f5ae89ee3981a96a1094

Former-commit-id: 876960a2cb [formerly 57d37e9761] [formerly 4399429e74] [formerly 2618c1a4e4 [formerly 4399429e74 [formerly 7a85b96863dece9c1b5a356f4e929665e0ce03f8]]]
Former-commit-id: 2618c1a4e4
Former-commit-id: 9f07a473781aa8232e833e400eac68c9f1b191a5 [formerly 82d713083a]
Former-commit-id: 617abbd8f1
This commit is contained in:
Mike Duff 2013-07-02 16:08:37 -05:00
parent 45070c3a98
commit a48d17ef7e
2 changed files with 5 additions and 20 deletions

View file

@ -734,8 +734,8 @@ public class AreaComp extends Composite implements ISubset {
// the dialog should always use an envelope in the same crs as the
// data.
try {
dlgEnvelope = MapUtil.reprojectAndIntersect(fullEnvelope,
dlgEnvelope);
dlgEnvelope = MapUtil.reprojectAndIntersect(dlgEnvelope,
fullEnvelope);
} catch (TransformException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);

View file

@ -286,6 +286,9 @@ public class EnvelopeUtils {
try {
ReferencedEnvelope e = new ReferencedEnvelope(crs);
latLon1 = normalizeLongitude(e, latLon1);
latLon2 = normalizeLongitude(e, latLon2);
DirectPosition2D dp1 = new DirectPosition2D(latLon1.x, latLon1.y);
DirectPosition2D dp2 = new DirectPosition2D(latLon2.x, latLon2.y);
MathTransform transform = MapUtil.getTransformFromLatLon(crs);
@ -321,9 +324,6 @@ public class EnvelopeUtils {
*/
public static ReferencedEnvelope createSubenvelopeFromLatLon(
Envelope envelope, Coordinate latLon1, Coordinate latLon2) {
latLon1 = EnvelopeUtils.convertToEastWest(latLon1);
latLon2 = EnvelopeUtils.convertToEastWest(latLon2);
ReferencedEnvelope result = createEnvelopeFromLatLon(
envelope.getCoordinateReferenceSystem(), latLon1, latLon2);
return new ReferencedEnvelope(result.intersection(reference(envelope)),
@ -358,19 +358,4 @@ public class EnvelopeUtils {
return new ReferencedEnvelope(envelope);
}
}
/**
* Convert coordinate value to East/West.
*
* @param coord
* Coordinate to convert
* @return converted coordinate
*/
public static Coordinate convertToEastWest(Coordinate coord) {
if (coord.x > 180) {
coord.x = coord.x - 360;
}
return coord;
}
}