Merge "Issue #2132 - review comments" into development
Former-commit-id:b14826f2a7
[formerly93c7fe3ac9
] [formerlya414049f39
] [formerlydaf64a7923
[formerlya414049f39
[formerly 62394f1d0d8ebcd9781b5c3e377469c04ebd7dc2]]] Former-commit-id:daf64a7923
Former-commit-id: 262993bd643ffe079d6a52742f3b7b653b9015f8 [formerly7606d9e7ff
] Former-commit-id:2bee69bceb
This commit is contained in:
commit
19e9081e8f
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