Issue #2132 - review comments
Change-Id: I65b880b5f96471b6f8e0f5ae89ee3981a96a1094 Former-commit-id:2618c1a4e4
[formerly 7a85b96863dece9c1b5a356f4e929665e0ce03f8] Former-commit-id:4399429e74
This commit is contained in:
parent
f12b08401f
commit
57d37e9761
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
|
// the dialog should always use an envelope in the same crs as the
|
||||||
// data.
|
// data.
|
||||||
try {
|
try {
|
||||||
dlgEnvelope = MapUtil.reprojectAndIntersect(fullEnvelope,
|
dlgEnvelope = MapUtil.reprojectAndIntersect(dlgEnvelope,
|
||||||
dlgEnvelope);
|
fullEnvelope);
|
||||||
} catch (TransformException e) {
|
} catch (TransformException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
||||||
e);
|
e);
|
||||||
|
|
|
@ -286,6 +286,9 @@ public class EnvelopeUtils {
|
||||||
try {
|
try {
|
||||||
ReferencedEnvelope e = new ReferencedEnvelope(crs);
|
ReferencedEnvelope e = new ReferencedEnvelope(crs);
|
||||||
|
|
||||||
|
latLon1 = normalizeLongitude(e, latLon1);
|
||||||
|
latLon2 = normalizeLongitude(e, latLon2);
|
||||||
|
|
||||||
DirectPosition2D dp1 = new DirectPosition2D(latLon1.x, latLon1.y);
|
DirectPosition2D dp1 = new DirectPosition2D(latLon1.x, latLon1.y);
|
||||||
DirectPosition2D dp2 = new DirectPosition2D(latLon2.x, latLon2.y);
|
DirectPosition2D dp2 = new DirectPosition2D(latLon2.x, latLon2.y);
|
||||||
MathTransform transform = MapUtil.getTransformFromLatLon(crs);
|
MathTransform transform = MapUtil.getTransformFromLatLon(crs);
|
||||||
|
@ -321,9 +324,6 @@ public class EnvelopeUtils {
|
||||||
*/
|
*/
|
||||||
public static ReferencedEnvelope createSubenvelopeFromLatLon(
|
public static ReferencedEnvelope createSubenvelopeFromLatLon(
|
||||||
Envelope envelope, Coordinate latLon1, Coordinate latLon2) {
|
Envelope envelope, Coordinate latLon1, Coordinate latLon2) {
|
||||||
latLon1 = EnvelopeUtils.convertToEastWest(latLon1);
|
|
||||||
latLon2 = EnvelopeUtils.convertToEastWest(latLon2);
|
|
||||||
|
|
||||||
ReferencedEnvelope result = createEnvelopeFromLatLon(
|
ReferencedEnvelope result = createEnvelopeFromLatLon(
|
||||||
envelope.getCoordinateReferenceSystem(), latLon1, latLon2);
|
envelope.getCoordinateReferenceSystem(), latLon1, latLon2);
|
||||||
return new ReferencedEnvelope(result.intersection(reference(envelope)),
|
return new ReferencedEnvelope(result.intersection(reference(envelope)),
|
||||||
|
@ -358,19 +358,4 @@ public class EnvelopeUtils {
|
||||||
return new ReferencedEnvelope(envelope);
|
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