sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1786815 - in /sis/branches/JDK8/core/sis-referencing-by-identifiers/src: main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java test/java/org/apache/sis/referencing/gazetteer/LocationViewer.java
Date Mon, 13 Mar 2017 22:07:43 GMT
Author: desruisseaux
Date: Mon Mar 13 22:07:43 2017
New Revision: 1786815

URL: http://svn.apache.org/viewvc?rev=1786815&view=rev
Log:
Bug fix when determining if we are allowed to take a shortcut while iterating over the cells
in polar projection case.

Modified:
    sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
    sis/branches/JDK8/core/sis-referencing-by-identifiers/src/test/java/org/apache/sis/referencing/gazetteer/LocationViewer.java

Modified: sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java?rev=1786815&r1=1786814&r2=1786815&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
[UTF-8] Mon Mar 13 22:07:43 2017
@@ -1080,7 +1080,15 @@ public class MilitaryGridReferenceSystem
                 downward = (encoder.crsZone < 0);           // Upward in UTM North zones,
downward in UTM South zones.
             } else {
                 downward = yEnd <= PolarStereographicA.UPS_SHIFT;  // Downward only if
AOI is fully in the lower half.
-                isSpecialCase = (gridX < PolarStereographicA.UPS_SHIFT);         // Can
not optimize left side of UPS.
+                /*
+                 * In the polar case, we can not apply the shortcut documented in 'optimize'
if there is a hole
+                 * in the UPS projection center. There is a hole if the latitude of the area
of interest does not
+                 * reach the pole, or if the longitude range does not make a full circle
around the Earth.
+                 */
+                isSpecialCase        |=        λmin != Longitude.MIN_VALUE ||
+                                               λmax != Longitude.MAX_VALUE ||
+                        (encoder.crsZone < 0 ? φmin != Latitude .MIN_VALUE
+                                             : φmax != Latitude .MAX_VALUE);
             }
             if (downward) {
                 final int y = gridY;

Modified: sis/branches/JDK8/core/sis-referencing-by-identifiers/src/test/java/org/apache/sis/referencing/gazetteer/LocationViewer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing-by-identifiers/src/test/java/org/apache/sis/referencing/gazetteer/LocationViewer.java?rev=1786815&r1=1786814&r2=1786815&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing-by-identifiers/src/test/java/org/apache/sis/referencing/gazetteer/LocationViewer.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing-by-identifiers/src/test/java/org/apache/sis/referencing/gazetteer/LocationViewer.java
[UTF-8] Mon Mar 13 22:07:43 2017
@@ -32,7 +32,6 @@ import javax.swing.JPanel;
 import org.opengis.geometry.Envelope;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.crs.SingleCRS;
-import org.opengis.referencing.gazetteer.Location;
 import org.opengis.referencing.operation.MathTransform2D;
 import org.opengis.referencing.operation.TransformException;
 import org.apache.sis.internal.referencing.j2d.IntervalRectangle;
@@ -42,6 +41,9 @@ import org.apache.sis.referencing.Common
 import org.apache.sis.referencing.CRS;
 import org.apache.sis.util.Debug;
 
+// Branch-dependent imports
+import org.opengis.referencing.gazetteer.Location;
+
 
 /**
  * A Swing panel drawing {@link Location} instances.



Mime
View raw message