sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1685096 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/io/wkt/ sis-referencing/src/main/java/org/apache/sis/referencing/crs/ sis-referencing/src/test/java/org/apache/sis/io/wkt/
Date Fri, 12 Jun 2015 14:50:01 GMT
Author: desruisseaux
Date: Fri Jun 12 14:50:01 2015
New Revision: 1685096

URL: http://svn.apache.org/r1685096
Log:
WKT: replaced 'ignoreAxisOrder' boolean flag by Convention.WKT1_IGNORE_AXES enumeration value.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] Fri Jun 12 14:50:01 2015
@@ -38,15 +38,19 @@ import org.apache.sis.metadata.iso.citat
  *       according the OGC 01-009 (<cite>Coordinate transformation services</cite>)
specification.</li>
  *   <li>An older specification — <cite>Simple Features</cite> — was
unclear on this matter and has been
  *       interpreted by many softwares as fixing the unit to decimal degrees.</li>
+ *   <li>Some softwares support only (<var>longitude</var>, <var>latitude</var>)
axis order
+ *       and ignore completely all {@code AXIS[…]} elements in the WKT.</li>
  * </ul>
  *
  * Despite the first interpretation being specified by both OGC 01-009 and ISO 19162 standards,
the second
  * interpretation appears to be in wide use for WKT 1. Apache SIS uses the standard interpretation
by default,
  * but the {@link #WKT1_COMMON_UNITS} enumeration allows parsing and formatting using the
older interpretation.
+ * The {@link #WKT1_IGNORE_AXES} enumeration mimics the most minimalist WKT 1 parsers,
+ * but should be avoided when not imposed by compatibility reasons.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.6
  * @module
  *
  * @see WKTFormat#getConvention()
@@ -66,7 +70,7 @@ public enum Convention {
      *
      * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT
2 specification</a>
      */
-    WKT2(false),
+    WKT2(false, false),
 
     /**
      * The ISO 19162 format with omission of some optional elements. This convention is identical
@@ -91,7 +95,7 @@ public enum Convention {
      *
      * <p>This is the default convention used by {@link FormattableObject#toString()}.</p>
      */
-    WKT2_SIMPLIFIED(false),
+    WKT2_SIMPLIFIED(false, false),
 
     /**
      * The OGC 01-009 format, also known as “WKT 1”.
@@ -119,7 +123,7 @@ public enum Convention {
      *
      * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy
WKT 1</a>
      */
-    WKT1(true),
+    WKT1(true, false),
 
     /**
      * The <cite>Simple Feature</cite> format, also known as “WKT 1”.
@@ -136,7 +140,24 @@ public enum Convention {
      *       (e.g. <cite>"meter"</cite> instead than <cite>"metre"</cite>).</li>
      * </ul>
      */
-    WKT1_COMMON_UNITS(true),
+    WKT1_COMMON_UNITS(true, true),
+
+    /**
+     * The <cite>Simple Feature</cite> format without parsing of axis elements.
+     * This convention is identical to {@link #WKT1_COMMON_UNITS} except that all {@code
AXIS[…]} elements are ignored.
+     * Since the WKT 1 specification said that the default axis order shall be (<var>x</var>,<var>y</var>)
or
+     * (<var>longitude</var>, <var>latitude</var>), ignoring {@code
AXIS[…]} elements is equivalent to forcing
+     * the coordinate systems to that default order.
+     *
+     * <p>Note that {@code AXIS[…]} elements still need to be well formed even when
parsing a text with this convention.
+     * Malformed axis elements will continue to cause a {@link java.text.ParseException}
despite their content being ignored.</p>
+     *
+     * <p>This convention may be useful for compatibility with some other softwares
that do not handle axis order correctly.
+     * But except when imposed by such compatibility reasons, this convention should be avoided
as much as possible.</p>
+     *
+     * @since 0.6
+     */
+    WKT1_IGNORE_AXES(true, true),
 
     /**
      * A special convention for formatting objects as stored internally by Apache SIS.
@@ -167,7 +188,7 @@ public enum Convention {
      * @see org.apache.sis.referencing.operation.projection.NormalizedProjection#getParameterValues()
      */
     @Debug
-    INTERNAL(false);
+    INTERNAL(false, false);
 
     /**
      * The default conventions.
@@ -180,10 +201,24 @@ public enum Convention {
     private final boolean isWKT1;
 
     /**
+     * {@code true} for a frequently-used convention about units instead than the standard
one.
+     * <ul>
+     *   <li>If {@code true}, forces {@code PRIMEM} and {@code PARAMETER} angular units
to degrees
+     *       instead than inferring the unit from the context. The standard value is {@code
false},
+     *       which means that the angular units are inferred from the context as required
by the
+     *       WKT 1 specification.</li>
+     *   <li>If {@code true}, uses US unit names instead of the international names.
+     *       For example Americans said {@code "meter"} instead of {@code "metre"}.</li>
+     * </ul>
+     */
+    final boolean usesCommonUnits;
+
+    /**
      * Creates a new enumeration value.
      */
-    private Convention(final boolean isWKT1) {
+    private Convention(final boolean isWKT1, final boolean usesCommonUnits) {
         this.isWKT1 = isWKT1;
+        this.usesCommonUnits = usesCommonUnits;
     }
 
     /**
@@ -217,21 +252,6 @@ public enum Convention {
     }
 
     /**
-     * {@code true} for a frequently-used convention about units instead than the standard
one.
-     * <ul>
-     *   <li>If {@code true}, forces {@code PRIMEM} and {@code PARAMETER} angular units
to degrees
-     *       instead than inferring the unit from the context. The standard value is {@code
false},
-     *       which means that the angular units are inferred from the context as required
by the
-     *       WKT 1 specification.</li>
-     *   <li>If {@code true}, uses US unit names instead of the international names.
-     *       For example Americans said {@code "meter"} instead of {@code "metre"}.</li>
-     * </ul>
-     */
-    final boolean usesCommonUnits() {
-        return this == WKT1_COMMON_UNITS;
-    }
-
-    /**
      * Returns the default authority to look for when fetching identified object names and
identifiers.
      * The difference between various authorities are most easily seen in projection and
parameter names.
      * The value returned by this method can be overwritten by {@link WKTFormat#setNameAuthority(Citation)}.

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Fri Jun 12 14:50:01 2015
@@ -1143,7 +1143,7 @@ public class Formatter implements Locali
             } else if (NonSI.DEGREE_ANGLE.equals(unit)) {
                 buffer.append("degree");
             } else if (SI.METRE.equals(unit)) {
-                buffer.append(convention.usesCommonUnits() ? "meter" : "metre");
+                buffer.append(convention.usesCommonUnits ? "meter" : "metre");
             } else if (Units.PPM.equals(unit)) {
                 buffer.append("parts per million");
             } else {
@@ -1321,7 +1321,7 @@ public class Formatter implements Locali
      */
     @SuppressWarnings("unchecked")
     public <Q extends Quantity> Unit<Q> addContextualUnit(final Unit<Q>
unit) {
-        if (unit == null || convention.usesCommonUnits()) {
+        if (unit == null || convention.usesCommonUnits) {
             return null;
         }
         hasContextualUnit |= 1;
@@ -1353,7 +1353,7 @@ public class Formatter implements Locali
                  * However this check does not work in Convention.WKT1_COMMON_UNITS mode,
since the
                  * map is always empty in that mode.
                  */
-                if (!convention.usesCommonUnits()) {
+                if (!convention.usesCommonUnits) {
                     throw new IllegalStateException();
                 }
             }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
[UTF-8] Fri Jun 12 14:50:01 2015
@@ -145,16 +145,6 @@ final class GeodeticObjectParser extends
     private final Convention convention;
 
     /**
-     * {@code true} if {@code AXIS[...]} elements should be ignored.
-     * This is sometime used for simulating a "force longitude first axis order" behavior.
-     * This is also used for compatibility with softwares that ignore axis elements.
-     *
-     * <p>Note that {@code AXIS} elements still need to be well formed even when this
flag is set to {@code true}.
-     * Malformed axis elements will continue to cause a {@link ParseException} despite their
content being ignored.</p>
-     */
-    private final boolean isAxisIgnored;
-
-    /**
      * A map of properties to be given the factory constructor methods.
      * This map will be recycled for each object to be parsed.
      */
@@ -164,7 +154,7 @@ final class GeodeticObjectParser extends
      * Creates a parser using the default set of symbols and factories.
      */
     public GeodeticObjectParser() {
-        this(Symbols.getDefault(), null, null, Convention.DEFAULT, false, null, null);
+        this(Symbols.getDefault(), null, null, Convention.DEFAULT, null, null);
     }
 
     /**
@@ -191,7 +181,6 @@ final class GeodeticObjectParser extends
         referencing   = ReferencingServices.getInstance();
         opFactory     = referencing.getCoordinateOperationFactory(defaultProperties, mtFactory);
         convention    = Convention.DEFAULT;
-        isAxisIgnored = false;
     }
 
     /**
@@ -202,13 +191,11 @@ final class GeodeticObjectParser extends
      * @param numberFormat  The number format provided by {@link WKTFormat}, or {@code null}
for a default format.
      * @param dateFormat    The date format provided by {@link WKTFormat}, or {@code null}
for a default format.
      * @param convention    The WKT convention to use.
-     * @param isAxisIgnored {@code true} if {@code AXIS} elements should be ignored.
      * @param errorLocale   The locale for error messages (not for parsing), or {@code null}
for the system default.
      * @param factories     On input, the factories to use. On output, the factories used.
Can be null.
      */
     GeodeticObjectParser(final Symbols symbols, final NumberFormat numberFormat, final DateFormat
dateFormat,
-            final Convention convention, final boolean isAxisIgnored, final Locale errorLocale,
-            final Map<Class<?>,Factory> factories)
+            final Convention convention, final Locale errorLocale, final Map<Class<?>,Factory>
factories)
     {
         super(symbols, numberFormat, dateFormat, getFactory(MathTransformFactory.class, factories),
errorLocale);
         crsFactory   = getFactory(CRSFactory.class,   factories);
@@ -217,7 +204,6 @@ final class GeodeticObjectParser extends
         referencing  = ReferencingServices.getInstance();
         opFactory    = referencing.getCoordinateOperationFactory(null, mtFactory);
         this.convention = convention;
-        this.isAxisIgnored = isAxisIgnored;
     }
 
     /**
@@ -556,6 +542,16 @@ final class GeodeticObjectParser extends
     }
 
     /**
+     * Returns {@code true} if axes should be ignored.
+     *
+     * @param  axis The first parsed axis (can be {@code null}).
+     * @return {@code true} for ignoring the given axis and all other ones in the current
coordinate system.
+     */
+    private boolean isAxisIgnored(final CoordinateSystemAxis axis) {
+        return (axis == null) || (convention == Convention.WKT1_IGNORE_AXES);
+    }
+
+    /**
      * Parses a {@code "PRIMEM"} element. This element has the following pattern:
      *
      * {@preformat text
@@ -568,7 +564,7 @@ final class GeodeticObjectParser extends
      * @throws ParseException if the {@code "PRIMEM"} element can not be parsed.
      */
     private PrimeMeridian parsePrimem(final Element parent, Unit<Angle> angularUnit)
throws ParseException {
-        if (convention == Convention.WKT1_COMMON_UNITS) {
+        if (convention.usesCommonUnits) {
             angularUnit = NonSI.DEGREE_ANGLE;
         }
         final Element element   = parent.pullElement(WKTKeywords.PrimeM);
@@ -834,7 +830,7 @@ final class GeodeticObjectParser extends
                 axis2 = parseAxis(element, false, linearUnit, true);
             }
             final Map<String,?> properties = parseMetadataAndClose(element, name);
-            if (axis0 != null && !isAxisIgnored) {
+            if (!isAxisIgnored(axis0)) {
                 cs = csFactory.createCartesianCS(properties, axis0, axis1, axis2);
                 cs = referencing.upgradeGeocentricCS(cs);
             } else {
@@ -865,7 +861,7 @@ final class GeodeticObjectParser extends
         final Unit<Length>   linearUnit = parseUnit(element, WKTKeywords.LengthUnit,
SI.METRE);
         CoordinateSystemAxis axis       = parseAxis(element, false, linearUnit, false);
         try {
-            if (axis == null || isAxisIgnored) {
+            if (isAxisIgnored(axis)) {
                 String sn = "Height", abbreviation = "h";
                 AxisDirection direction = AxisDirection.UP;
                 final VerticalDatumType type = datum.getVerticalDatumType();
@@ -902,7 +898,7 @@ final class GeodeticObjectParser extends
         final Unit<Duration> timeUnit = parseUnit(element, WKTKeywords.TimeUnit, SI.SECOND);
         CoordinateSystemAxis axis     = parseAxis(element, false, timeUnit, false);
         try {
-            if (axis == null || isAxisIgnored) {
+            if (isAxisIgnored(axis)) {
                 axis = createAxis("Time", "t", AxisDirection.FUTURE, timeUnit);
             }
             return crsFactory.createTemporalCRS(parseMetadataAndClose(element, name), datum,
@@ -943,7 +939,7 @@ final class GeodeticObjectParser extends
             if (axis0 != null) {
                 axis1 = parseAxis(element, true, angularUnit, true);
             }
-            if (axis0 == null || isAxisIgnored) {
+            if (isAxisIgnored(axis0)) {
                 axis0 = createAxis(AxisNames.GEODETIC_LONGITUDE, "λ", AxisDirection.EAST,
 angularUnit);
                 axis1 = createAxis(AxisNames.GEODETIC_LATITUDE,  "φ", AxisDirection.NORTH,
angularUnit);
             }
@@ -973,7 +969,7 @@ final class GeodeticObjectParser extends
         final String        name       = element.pullString("name");
         final GeographicCRS geoCRS     = parseGeoGCS(element);
         final Unit<Length>  linearUnit = parseUnit(element, WKTKeywords.LengthUnit,
SI.METRE);
-        final boolean  usesCommonUnits = convention.usesCommonUnits();
+        final boolean  usesCommonUnits = convention.usesCommonUnits;
         final Conversion    conversion = parseProjection(element,
                 usesCommonUnits ? SI.METRE : linearUnit,
                 usesCommonUnits ? NonSI.DEGREE_ANGLE : geoCRS.getCoordinateSystem().getAxis(0).getUnit().asType(Angle.class));
@@ -983,7 +979,7 @@ final class GeodeticObjectParser extends
             if (axis0 != null) {
                 axis1 = parseAxis(element, false, linearUnit, true);
             }
-            if (axis0 == null || isAxisIgnored) {
+            if (isAxisIgnored(axis0)) {
                 axis0 = createAxis(AxisNames.EASTING,  "E", AxisDirection.EAST,  linearUnit);
                 axis1 = createAxis(AxisNames.NORTHING, "N", AxisDirection.NORTH, linearUnit);
             }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java [UTF-8]
Fri Jun 12 14:50:01 2015
@@ -20,7 +20,7 @@ import org.opengis.util.FactoryException
 
 
 /**
- * Interfaces of objects creating an object from a WKT.
+ * Interfaces of parsers or factories creating a math transform or geodetic object from a
WKT.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
@@ -30,8 +30,11 @@ import org.opengis.util.FactoryException
 public interface Parser {
     /**
      * Creates the object from a string.
+     * Objects returned by this method are typically (but not necessarily)
+     * {@linkplain org.apache.sis.referencing.crs.AbstractCRS Coordinate Reference Systems}
or
+     * {@linkplain org.apache.sis.referencing.operation.transform.AbstractMathTransform Math
Transforms}.
      *
-     * @param  text Coordinate system encoded in Well-Known Text format (version 1 or 2).
+     * @param  text Object encoded in Well-Known Text format (version 1 or 2).
      * @return The result of parsing the given text.
      * @throws FactoryException if the object creation failed.
      */

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
[UTF-8] Fri Jun 12 14:50:01 2015
@@ -524,7 +524,7 @@ public class WKTFormat extends CompoundF
             this.parser = parser = new GeodeticObjectParser(symbols,
                     (NumberFormat) getFormat(Number.class),
                     (DateFormat)   getFormat(Date.class),
-                    convention, false, getLocale(), factories);
+                    convention, getLocale(), factories);
         }
         try {
             return parser.parseObject(text.toString(), pos);

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Warnings.java
[UTF-8] Fri Jun 12 14:50:01 2015
@@ -166,7 +166,7 @@ public final class Warnings implements L
 
     /**
      * Returns the non-fatal exceptions that occurred during the parsing or formatting.
-     * If no exception occurred, then returns an empty set.
+     * If no exception occurred, returns an empty set.
      *
      * @return The non-fatal exceptions that occurred.
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
[UTF-8] Fri Jun 12 14:50:01 2015
@@ -36,6 +36,7 @@ import org.apache.sis.referencing.Identi
 import org.apache.sis.referencing.cs.AxesConvention;
 import org.apache.sis.referencing.cs.AbstractCS;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.Formatter;
 
 import static org.apache.sis.util.Utilities.deepEquals;
@@ -520,10 +521,12 @@ public class AbstractCRS extends Abstrac
             formatter.append(toFormattable(cs)); // WKT2 only, since the concept of CoordinateSystem
was not explicit in WKT 1.
             formatter.indent(+1);
         }
-        final int dimension = cs.getDimension();
-        for (int i=0; i<dimension; i++) {
-            formatter.newLine();
-            formatter.append(toFormattable(cs.getAxis(i)));
+        if (!isWKT1 || formatter.getConvention() != Convention.WKT1_IGNORE_AXES) {
+            final int dimension = cs.getDimension();
+            for (int i=0; i<dimension; i++) {
+                formatter.newLine();
+                formatter.append(toFormattable(cs.getAxis(i)));
+            }
         }
         if (!isWKT1) { // WKT 2 writes unit after axes, while WKT 1 wrote them before axes.
             formatter.newLine();

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java?rev=1685096&r1=1685095&r2=1685096&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
[UTF-8] Fri Jun 12 14:50:01 2015
@@ -88,9 +88,9 @@ public final strictfp class GeodeticObje
     /**
      * Uses a new parser for the given convention.
      */
-    private void setConvention(final Convention convention, final boolean isAxisIgnored)
{
+    private void setConvention(final Convention convention) {
         final GeodeticObjectParser p = parser;
-        parser = new GeodeticObjectParser(p.symbols, null, null, convention, isAxisIgnored,
p.errorLocale, null);
+        parser = new GeodeticObjectParser(p.symbols, null, null, convention, p.errorLocale,
null);
     }
 
     /**
@@ -346,7 +346,7 @@ public final strictfp class GeodeticObje
          * So we allow this interpretation in Convention.WKT1_COMMON_UNITS for compatibility
reasons.
          */
         wkt = wkt.replace("2.5969213", "2.33722917");   // Convert unit in prime meridian.
-        setConvention(Convention.WKT1_COMMON_UNITS, true);
+        setConvention(Convention.WKT1_IGNORE_AXES);
         crs = parse(GeographicCRS.class, wkt);
         assertNameAndIdentifierEqual("NTF (Paris)", 0, crs);
         pm = verifyNTF(crs.getDatum(), false);
@@ -400,7 +400,7 @@ public final strictfp class GeodeticObje
         wkt = wkt.replace("52.0",      "46.8");             // Convert unit in “latitude_of_origin”
parameter.
         wkt = wkt.replace("600.0",     "600000");           // Convert unit in “false_easting”
parameter.
         wkt = wkt.replace("2200.0",    "2200000");          // Convert unit in “false_northing”
parameter.
-        setConvention(Convention.WKT1_COMMON_UNITS, true);
+        setConvention(Convention.WKT1_IGNORE_AXES);
         crs = parse(ProjectedCRS.class, wkt);
         assertNameAndIdentifierEqual("NTF (Paris) / Lambert zone II", 0, crs);
         verifyProjectedCS(crs.getCoordinateSystem(), SI.KILOMETRE);



Mime
View raw message