Issue #2132 - review comments
Change-Id: I65b880b5f96471b6f8e0f5ae89ee3981a96a1094 Former-commit-id:57d37e9761
[formerly4399429e74
] [formerly57d37e9761
[formerly4399429e74
] [formerly2618c1a4e4
[formerly 7a85b96863dece9c1b5a356f4e929665e0ce03f8]]] Former-commit-id:2618c1a4e4
Former-commit-id:617abbd8f1
[formerly82d713083a
] Former-commit-id:3e20961fe0
This commit is contained in:
parent
06ed1bc66c
commit
c1abe64b72
2 changed files with 5 additions and 20 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue