Merge "Issue #2132 - review comments" into development
Former-commit-id: 62394f1d0d8ebcd9781b5c3e377469c04ebd7dc2
This commit is contained in:
commit
a414049f39
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