sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1785052 - /sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
Date Wed, 01 Mar 2017 22:10:54 GMT
Author: desruisseaux
Date: Wed Mar  1 22:10:54 2017
New Revision: 1785052

URL: http://svn.apache.org/viewvc?rev=1785052&view=rev
Log:
Verify that the latitude band is inside expected range.

Modified:
    sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.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=1785052&r1=1785051&r2=1785052&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] Wed Mar  1 22:10:54 2017
@@ -1053,10 +1053,12 @@ parse:                  switch (part) {
                  * This estimation is needed because the 100 kilometres square identification
is insufficient;
                  * we may need to add some multiple of 2000 kilometres (20 squares).
                  */
-                λ0  = ZONER.centralMeridian(zone);
                 φs = latitudeBand * LATITUDE_BAND_HEIGHT + TransverseMercator.Zoner.SOUTH_BOUNDS;
+                if (latitudeBand < 0 || latitudeBand >= ROW_RESOLVER.length) {
+                    throw new GazetteerException(Resources.format(Resources.Keys.IllegalLatitudeBand_1,
Encoder.latitudeBand(φs)));
+                }
+                λ0  = ZONER.centralMeridian(zone);
                 crs = owner.projection(Math.signum(φs), λ0);
-
                 final int info = ROW_RESOLVER[latitudeBand];        // Contains the above-cited
northing value.
                 if (hasSquareIdentification) {
                     int rowBit = 1 << (row + NORTHING_BITS_COUNT);  // Bit mask of
the row to check for existence.



Mime
View raw message